How do I plot a table of results? where V is the table of results i want to plot

1 回表示 (過去 30 日間)
James Taylor
James Taylor 2016 年 3 月 11 日
コメント済み: Star Strider 2016 年 3 月 14 日
clear all
close all
clc
g=9.81;
Q = 1:0.1:40;
for i = 1:length(Q)
for Dpen=1:1:5;
A(1,Dpen)= pi*Dpen.^2/4;
V(i,Dpen)= Q(i)/A(1,Dpen);
%plot(Q,V(:,Dpen))
end
end

回答 (1 件)

Star Strider
Star Strider 2016 年 3 月 11 日
My choice would be:
Q = 1:0.1:40;
Dpen=1:1:5;
[Qm,Dm] = meshgrid(Q, Dpen);
V = Qm./(pi*Dm.^2/4);
figure(2)
mesh(Qm, Dm, V)
grid on
xlabel('Q')
ylabel('Dpen')
zlabel('V')
  2 件のコメント
James Taylor
James Taylor 2016 年 3 月 14 日
Thank you very much!
Star Strider
Star Strider 2016 年 3 月 14 日
My pleasure!
If my Answer solved your problem, please Accept it.

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by