How do I perform prelocation when creating an array using a for loop?
Show older comments
for example
Vcruise=[];
HPreq=[];
speedvalue=160;
for i=1:1:speedvalue
Vcruise=[Vcruise,i];
........
Ptotal_fwd=....
......
HPreq=[HPreq,PTotal_fwd];
end
and some graphical operations
Accepted Answer
More Answers (0)
Categories
Find more on Linear Algebra 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!