Basically I have a matrix of data that I am trying to curve fit. I am using the spap2 function. Since I have an array of data that I am looping through and for each iteration I am trying to store the output of spap2 into an array so that I can graph that array later on in another loop.
The problem can be split into two parts: 1) Storing the output of spap2 into an array. 2) Looping through the array with the spap2 functions and graphing each iteration (with a 0.5 seconds pause between each graph) to produce a "dynamic graph" that changes with time!
Your help is greatly appreciated.
Sample of code I am using is below:
for counter = 1:limit
curv = curvature(counter,:);
moment = curv.*(E*I);
LOC = -flip(locations);
Ycurv = flip(curv);
Ymoment = flip(moment);
W = flip(w);
sp = spap2(1, k , LOC, Ycurv , W);
sp2 = spap2 (1, k , LOC , Ymoment, W);
theta = fnint(sp);
deflectionarray(counter,1) = fnint(theta);
momentarray(counter,1) = sp2;
shear = fnder(sp2);
soilrctnarray(counter,1) = fnder(shear);