from workspace to m.file

3 Ansichten (letzte 30 Tage)
Recep
Recep am 31 Mär. 2011
Hello. I want to take a variable from workspace to m-file. After I will process this variable and I will send to simulink. Could you help me please?

Akzeptierte Antwort

Paulo Silva
Paulo Silva am 31 Mär. 2011
if your m file is just code (not a function) the variables are in the same scope as the worspace, you just need to call them like you do in the workspace, if you are inside a function you should provide the variable as argument to the function or use fun=evalin('base','funname') inside your function code to get the variable value from the workspace.
  7 Kommentare
Paulo Silva
Paulo Silva am 31 Mär. 2011
%initialize inputs
%loop x times or until some result if found
%start simulation and wait until it ends
%analyze simulation output and store info
%prepare inputs for another simulation
%return to start of the loop
Recep
Recep am 31 Mär. 2011
Thank you, I hope I can solve problem and error. If you find more information, please let me know.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Kaustubha Govind
Kaustubha Govind am 31 Mär. 2011
You might find it useful to read the documentation on Running Parallel Simulations. There is also Solution #1-6GRUQ3 that describes the broader usage of Parallel Computing Toolbox with Simulink.
  1 Kommentar
Recep
Recep am 31 Mär. 2011
Thank you, I hope I can solve problem and error. If you find more information, please let me know.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by