how to make smoother surf plot
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
if n == 1
Hz_snapshots(:,:,snap_count) = Hz; %save the current Hz
Ex_snapshots(:,:,snap_count) = Ex; %save the current Ex
Ey_snapshots(:,:,snap_count) = Ey; %save the current Ey
time_stamp(snap_count) = n; %save the time of the snapshot
snap_count = snap_count + 1; %increase the index for the next snapshot
elseif mod(n,round(nt/(ns-1))) == 0
Hz_snapshots(:,:,snap_count) = Hz; %save the current Hz
Ex_snapshots(:,:,snap_count) = Ex; %save the current Ex
Ey_snapshots(:,:,snap_count) = Ey; %save the current Ey
time_stamp(snap_count) = n; %save the time of the snapshot
snap_count = snap_count + 1; %increase the index for the next snapshot
end
xx = 0:dx:a;
yy = 0:dy:b;
[Y, X] = meshgrid(yy,xx);
surf(X,Y,Hz,'LineStyle','none', 'FaceColor', 'interp')
axis([0 a 0 b -1 1])
title(strcat('Hz Field at Time n = ',num2str(n)))
xlabel('x (m)')
ylabel('y (m)')
zlabel('Hz (V/m)')
Hello guys. I made a plot by using those statements. Hz is 101x81 matrix having the form of a checkerboard.
Ex, Hz= (2680, 0, 2680, 0, 2680;
0, 6308, 0, 6308, 0;
9359, 0, 9359, 0, 9359)
And I want to remove those 'spike shape' from my plot and change it to a smooth plot. How can I do this?
Or, if there is any method to remove '0' values from the Hz matrix and push the other values to the left, and plot it, please let me know.
Thanks!!
4 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!