I have built a simulink model for performing cartesian regulation on a unicycle:
and plot the results with a Matlab code
but, I am not very confident with Simulink and so I don’t know how to call these codes into my Simulink model.
Can somebody please help me?
There's a Matlab function block. Follow the example and your inputs and outputs will create source/sink connections on the Simulink block to wire in values.
I would only put the controller in there, and don't use the
clear all command - if it's not
persistent then a variable inside a function ceases to exist between function calls. Every call to the function wipes all the internal variables inside that function.
If you're wanting your data to be plotted at the end then you can use a To Workspace block and send the data out that way and plot from the console or script after the Simulink project finishes.
Answered by Chuck on October 20, 2020
1 Asked on October 20, 2020 by j-d
1 Asked on September 29, 2020 by muhammed-roshan
1 Asked on September 24, 2020 by recep-orak
1 Asked on July 26, 2020 by tushar-bandi
1 Asked on July 21, 2020 by figbar
Get help from others!