I have a function describing a SDOF state space with a sinusoidal input y in one script as follows:
function dz = system(t,z,option,K,M,fe,y0)
y = y0 * sin(2*pi*fe*t);
while in a separate script, I solve the ODE for different values of fe in a loop as follows:
y0 = 1;
T = 10;
fe = [1 2 3 4];
n_freq = length(fe);
[tn,z] = ode15s('systeme1DDL_Dahl_bal',[t(1) t(end)],K,M,y0,fe(kk));
How can I save the value of y (the base excitation input) for each iteration?
Thank you in advance!