for loop store data in 2d array

I need to store the data in an array. I have a plot Y versus the time (tfinal =m) and the Y value is calculated n-times from a n-loop. I need to store the data in mxn array The part of the m.file are the following
index=0
for i=1:Loop
t=0; %start time
t_end=40; %end time
t_sample=1; %sample interval for gathering data
........
j=1;
t_ar(1,t_end/t_sample+1)=0;
t_ar(1,j)=t;
Y1_ar(1,t_end/t_sample+1)=0;
Y1_ar(1,j)=Y1;
etc etc
end

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Asked:

on 26 Mar 2016

Commented:

on 26 Mar 2016

Community Treasure Hunt

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

Start Hunting!