From: Haitham BouAmmar on 19 Jan 2010 11:55 "Kristof " <kristofvancutsem(a)hotmail.com> wrote in message <h3f0mp$cse$1(a)fred.mathworks.com>... > "naser " <naser.sepehry(a)gmail.com> wrote in message <h3enqb$69k$1(a)fred.mathworks.com>... > > I have a simulink and I want to run from M-file. > > I use sim() function. > > I have to output in simulink file I use To Workspace to save it in matlab workspace. > > but I run M-file my output in simulink doesn't save in workspace. > > > > Can you help me how run a simulink in M-file and use output of simulink in this M-file? > > check the help file for 'simset' and the option 'DstWorkspace' Well I guess u have to export ur variables from simulink as for example x, and then it will be exported as a structure, so to access the values u need u have to go like x.signals.values. I hope this helps
From: Haitham BouAmmar on 19 Jan 2010 11:56 "Kristof " <kristofvancutsem(a)hotmail.com> wrote in message <h3f0mp$cse$1(a)fred.mathworks.com>... > "naser " <naser.sepehry(a)gmail.com> wrote in message <h3enqb$69k$1(a)fred.mathworks.com>... > > I have a simulink and I want to run from M-file. > > I use sim() function. > > I have to output in simulink file I use To Workspace to save it in matlab workspace. > > but I run M-file my output in simulink doesn't save in workspace. > > > > Can you help me how run a simulink in M-file and use output of simulink in this M-file? > > check the help file for 'simset' and the option 'DstWorkspace' Well I guess u have to export ur variables from simulink as for example x, and then it will be exported as a structure, so to access the values u need u have to go like x.signals.values. I hope this helps
|
Pages: 1 Prev: Trouble with Matlab Embedded Function Coding Next: simulink geartrain? |