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 Exchange에서 Line 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