very simple plotting question EASY PLOT HELP

ok so i am trying to get values from my function and then plot them. am i doing this right? finddata function spits out scalar values for T,P,rho. but my values for T,P,rho continuously change and are not stored in a vector for the variables when i use the debugger i see this. it y,w,z should all end up being a 1x40 array but they are not.
x = 1:10000:400000;
for i = 0:10000:400000
[T,P,rho] = finddata(i);
ynew = T;
y = ynew+1;
wnew = P;
w = wnew+1;
znew = rho;
z = znew+1;
end
plot(x,y) plot(x,w) plot(x,z)

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 1 月 14 日
編集済み: Azzi Abdelmalek 2014 年 1 月 14 日

0 投票

x = 1:10000:400000;
for i = 1:numel(x)
[T,P,rho] = finddata(x(i));
y(i) = T+1;
w(i) = P+1;
z(i) = rho+1;
end
plot(x,y,x,w,x,z)

カテゴリ

ヘルプ センター および File ExchangeLine Plots についてさらに検索

質問済み:

Ben
2014 年 1 月 14 日

編集済み:

2014 年 1 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by