From: Chandrasekhar on 2 Nov 2009 06:26 "Salvador de Lira" <salvador.de.lira(a)upc.edu> wrote in message <hcmdil$2b9$1(a)fred.mathworks.com>... > Hello every body, i need your help, i running a function in a m-file, where i call to simulink by sim() at the same time i using lab data to simulink, the problem that i am having appear when i run mi function doesn't recognize my data already stored at workspace. Any body now how to call workspace data during simulation called by a function, i really appreciate your help. > Regards hi salvador try this ASSIGNIN(WS,'name',V), assigns variable in workspace --chan
From: Arnaud Miege on 2 Nov 2009 08:12 "Chandrasekhar " <kasimkotasekhar(a)gmail.com> wrote in message news:hcmfk9$ll8$1(a)fred.mathworks.com... > "Salvador de Lira" <salvador.de.lira(a)upc.edu> wrote in message > <hcmdil$2b9$1(a)fred.mathworks.com>... >> Hello every body, i need your help, i running a function in a m-file, >> where i call to simulink by sim() at the same time i using lab data to >> simulink, the problem that i am having appear when i run mi function >> doesn't recognize my data already stored at workspace. Any body now how >> to call workspace data during simulation called by a function, i really >> appreciate your help. >> Regards > > > hi salvador > try this > ASSIGNIN(WS,'name',V), assigns variable in workspace > > --chan > That's because the Simulink model is called from within a MATLAB function, therefore it looks into the function workspace, not the base workspace. Using assignin as suggested should solve your problem: http://www.mathworks.com/access/helpdesk/help/techdoc/ref/assignin.html HTH, Arnaud
|
Pages: 1 Prev: Always recieve error after m-file execution Next: problem with the execution of CLAHE algo |