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

2 views (last 30 days)
for i=1:5
x(i)=i+1;
end
disp(x(i));

Accepted Answer

Walter Roberson
Walter Roberson on 4 Jul 2015
disp(x);

More Answers (0)

Categories

Find more on Numeric Types 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!