MATLAB: How to plot a matrix of data over a period of time

arraysMATLABplotting

I currently have a function that outputs two 100×1 double arrays, let's call them A and B. A is an array of positions, and B is an array of the temperature at each position. This function is dependent on time t. I have a loop that runs the function for t = 1:60. I would like to save the A and B data for each time t and then plot the full data over all time. My main issue comes from saving the A and B arrays together for each time t.
I would appreciate any help with this. Thank you.

Best Answer

t = 1:1:60 ; % time
nt = length(time) ;
Am = zeros(100,nt) ;
Bm = zeros(100,nt) ;
for i = 1:t
% run your functions here which gives A and B
Am(:,i) = A ;
Bm(:,i) = B ;
end