how to make smoother surf plot
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!