我想要实现一个高斯输入矩形形式和圆形式,对不起,我不知道为什么第一次工作,但seconed不是。错误:“数组索引必须是正整数或逻辑值”。有人能帮我
x = -L_x / 2: dx_coarse: L_x / 2;
y = -L_y / 2: dy_coarse: L_y / 2;
n = ((y)长度,长度(x)) * n_glass;
GaussInput = 1 * exp (-xg1。^ 2 / (2 * (sigma_x)) ^ 2 -yg1。^ 2 / (2 * (sigma_y)) ^ 2);
激发。coup_center = [y((长度(y) + 1) / 2 + y_coupcenter * 1 e6), x((长度(x) + 1) / 2 + x_coupcenter * 1 e6)];
激发。gausscoup =√(xg (:,: 1) -Excitation.coup_center (2)) ^ 2 + (yg (:,: 1) -Excitation.coup_center (1)) ^ 2) < = rad_coup;
一个= GaussInput (Excitation.gausscoup);
激发。gausscoup = 0(长度(y),长度(x));
Excitation.gausscoup (n_dim (1) + 1) / 2 - y_coupcenter * 1 e6长度/ (2 * dy_coarse * 1 e6): (n_dim (1) 1) / 2 - y_coupcenter * 1 e6 +长度/ (2 * dy_coarse * 1 e6), (n_dim (2) + 1) / 2 - x_coupcenter * 1 e6宽度/ (2 * dx_coarse * 1 e6): (n_dim (2) - 1) / 2 - x_coupcenter * 1 e6 +宽/ (2 * dx_coarse * 1 e6)) = 1;
一个= GaussInput (Excitation.gausscoup);