variables in Simulink Workspace
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I have created a variable 'simout' with the To Workspace block in Simulink. Now I have to use this in a m file, but an error indicates that 'simout' is not defined. How to import this in a m file?
Thanks Senmeis
0 Kommentare
Antworten (4)
Azzi Abdelmalek
am 19 Okt. 2012
If it's In workspace, means it's recognized by m file. check your to workspace block, then set save format to array
0 Kommentare
dimitris
am 19 Okt. 2012
Simulink resolves variables from base workspace, so if you use simout from a function it wont be able to 'see' it because functions use their own workspace. The following link might help you.
0 Kommentare
Owen
am 22 Okt. 2012
2 Kommentare
Azzi Abdelmalek
am 22 Okt. 2012
Bearbeitet: Azzi Abdelmalek
am 22 Okt. 2012
Owen, Variables from to workspace block are seen by any m file, (except Functions). Check if your variable is simout and not Simout or any typo error. To be sur rename it 'x' for e.g
Kaustubha Govind
am 23 Okt. 2012
Bearbeitet: Kaustubha Govind
am 23 Okt. 2012
Oops, I meant to say that you need to use:
options=simset('SrcWorkspace','current','DstWorkspace','current');
sim('mymdl',[0 duration],options)
So that 'To Workspace' writes to the function workspace.
Siehe auch
Kategorien
Mehr zu Simulink Functions finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!