If I have the following function and solver script:
The function is:
function dydt = odefcn(t,y,A,B)dydt = zeros(2,1);dydt(1) = y(2);dydt(2) = (A/B)*t.*y(1);
The solver script:
A = 1;B = 2;tspan = [0 5];y0 = [0 0.01];[t,y] = ode45(@(t,y) odefcn(t,y,A,B), tspan, y0);
How can I combine both to create a "MATLAB function" block in Simulink that takes A and B as input, and outputs y?
Thanks a lot!
Best Answer