very simple plotting question EASY PLOT HELP
Show older comments
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)
Answers (1)
Azzi Abdelmalek
on 14 Jan 2014
Edited: Azzi Abdelmalek
on 14 Jan 2014
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)
Categories
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!