Plotting surface instead of line

2 ビュー (過去 30 日間)
Abcdefghi Abcdef
Abcdefghi Abcdef 2021 年 5 月 18 日
コメント済み: Jonas 2021 年 5 月 18 日
I am creating a gif of a number of 3D plots where x and y are between 0 and 1. However, MatLab is only plotting the data (which is stored in a matrix) of the line where x and y are equal, and not the total surface.
How can I fix it? Thank you in advance
Here is the figure code:
n = 1:steps;
nImages = length(n);
x = (0:0.05:1)';
y = (0:0.05:1)';
fig = figure;
for idx = 1:nImages
z = final_matrix(:, :, idx);
plot3(x,y,z,'LineWidth',3)
xlim([0 1]);
ylim([0 1]);
zlim([0 5]);
xlabel('\xi');
ylabel('\eta');
title(['\phi for \tau = ' num2str( n(round(idx, 3))*0.025 - 0.025) ])
drawnow
frame = getframe(fig);
im{idx} = frame2im(frame);
end
close;

採用された回答

Jonas
Jonas 2021 年 5 月 18 日
it you want to plot the surface then use the surf(x,y,z) command
  2 件のコメント
Abcdefghi Abcdef
Abcdefghi Abcdef 2021 年 5 月 18 日
I was not aware of this function.
It solved the problem.
Thank you for the help.
Jonas
Jonas 2021 年 5 月 18 日
no problem ;)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVisual Exploration についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by