Only saving last run for loop

1 次查看(过去 30 天)
This is my code
for i=1: 560;
z=z+dz;
pie=pie-((g/(cp*thetav(z)))*z);
end
I need pie for later calculations. The problem is that it only saves the last value of pie, and forgets all the rest. Is there a way to fix this?
Thanks
  3 个评论
Alexander Garber
Alexander Garber 2021-4-12
ok i will check it out, thanks!!

请先登录,再进行评论。

采纳的回答

David Hill
David Hill 2021-4-11
pie(1)=0;
for i=1: 560;
z=z+dz;
pie(i+1)=pie(i)-((g/(cp*thetav(z)))*z);
end
  1 个评论
Alexander Garber
Alexander Garber 2021-4-11
How would I plot that? My current plot just has many horizontal lines. Is there a way to assign a specific z value for each data point?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Pie Charts 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by