Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.

Ansys Learning Forum Forums Discuss Simulation Photonics FDTD crash when plotting figures using script Reply To: FDTD crash when plotting figures using script

vince
Subscriber
I tried your code, it doesn't crash. I also tried "image", it doesn't crash neither.
x = linspace(-20,20, 500)*1e-6;
y = linspace(-20,20, 500)*1e-6;
Gaussian = matrix(length(x),length(y));
for(i=1:length(x)){
for(j=1:length(y)){
Gaussian(i,j) = exp(-((x(i)/sigma)^2)+(y(j)/sigma)^2);
}}
image(x,y,Gaussian);
[bingo_chatbox]