Hello,
I did a xls model in simulink and a matlab script for a SMC controller and I was expecting the same resutl for both, but is not exactly the same. After looking for both programs, I realized that I'm using a ode4 solver in the simulink xls and seems for me that this is the main issue (I saved the time vector from simuink and use it in the .mat, the results where the same)
I'm quite lost with ode's in matlab, and more if I have to solve this control algorithm... Please How can I use ode4 in my matlab script? I have searched in the forum and in matlab help and I have found this link, but I dont get the point on how to use the function:
I see that ode uses this fucntion to work where I have to use my starting time, time step, final time and initial conditions. I'm lostwith the F function part. I dont know how can I integrate this in my code.
yout = ODE4(F,t0,h,tfinal,y0)
attached bot scripts, Thanks in advance!