Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

how loop output store

Asked by sonu on 18 Apr 2013

hi

i have loop output in terms of price after every loop i got the price value ...how can i see this price value in table form..in continuous manner store in one veritable...

0 Comments

sonu

Products

No products are associated with this question.

1 Answer

Answer by Iman Ansari on 18 Apr 2013
Edited by Iman Ansari on 18 Apr 2013
Accepted answer

Hi. What is the size of your price value in each loop:

for i=1:n
% if it is a number
output(i,1)=price;
% if it is a column vector
output(:,i)=price;
% if it is a row vector
output(i,:)=price;
% if it is a matrix or its size changes in each loop
output{i}=price;
end  

1 Comment

sonu on 25 Apr 2013

THNX

Iman Ansari

Contact us