i would like to get all values of for loop outside loop,but this program gives me the last value only

2 次查看(过去 30 天)
for i=1:5
x(i)=i+1;
end
disp(x(i));

采纳的回答

Walter Roberson
Walter Roberson 2015-7-4
disp(x);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Entering Commands 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by