Hi.
I've got a matlab GUI. I want to read outputs of some
simulink blocks from the GUI program and update in real-time
some values of text boxes of the GUI. How can I do?
Thanks.
Subject: Re: communication between simulink and matlab gui
"Andrea Monastero" <andrea.monastero@gmail.com> wrote in
message <fv9h4j$t6d$1@fred.mathworks.com>...
> Hi.
> I've got a matlab GUI. I want to read outputs of some
> simulink blocks from the GUI program and update in real-time
> some values of text boxes of the GUI. How can I do?
>
> Thanks.
Hai,
You can write the Simulink Block output values into a .mat
file using 'To File' block and read the same file from the
matlab GUI.
or else similarly you can also make use of 'To Workspace'
block and then read the workspace parameters from the matlab
GUI.
Regards,
Ashwini
Subject: Re: communication between simulink and matlab gui
Yes I know, but in this way, if I run the simulation from
the GUI with the command "sim(...)", I've got to wait the
end of the simulation before execute the instruction which
reads the file. I need a real time response...
"Ashwini Deshpande" <vd.ashwini@mathworks.com> wrote in
message <fvbi3v$624$1@fred.mathworks.com>...
...
> You can write the Simulink Block output values into a .mat
> file using 'To File' block and read the same file from the
> matlab GUI.
...
Subject: Re: communication between simulink and matlab gui
> Yes I know, but in this way, if I run the simulation from
> the GUI with the command "sim(...)", I've got to wait the
> end of the simulation before execute the instruction which
> reads the file. I need a real time response...
Use set_param(bdroot, 'SimulationCommand', 'Start') to run
the simulation asynchronously.
Is there a way to plot in a GUI window, realtime, the
values that are being generated by a simulink model? Like
having a scope but within a GUI screen?
-Beth W.
Ralph Schleicher <rs@ralph-schleicher.de> wrote in message
<878wyuvuwu.fsf@echo.mueller-schleicher.i>...
> "Andrea Monastero" <andrea.monastero@gmail.com> writes:
>
> > Yes I know, but in this way, if I run the simulation
from
> > the GUI with the command "sim(...)", I've got to wait
the
> > end of the simulation before execute the instruction
which
> > reads the file. I need a real time response...
>
> Use set_param(bdroot, 'SimulationCommand', 'Start') to
run
> the simulation asynchronously.
>
> --
> Ralph Schleicher, Freelance Engineer http://ralph-
schleicher.de
>
> Development * Consulting * Training
> Mathematical Modeling and Simulation
> Software Tools
Subject: Re: communication between simulink and matlab gui
> Is there a way to plot in a GUI window, realtime, the
> values that are being generated by a simulink model? Like
> having a scope but within a GUI screen?
Yes of course. Add a call-back function to your GUI returning
the handles of the UI objects. Write an M-file S-function with
the Simulink signals as input. Query and cache the UI object
handles in the StartFcn, then update the UI objects in the
mdlUpdate procedure. Done that, works like a charm.
Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central. Read the complete Disclaimer prior to use.