Thread Subject:
How to plat variables in a GUI while simulating a model ?

Subject: How to plat variables in a GUI while simulating a model ?

From: Marius

Date: 4 Jul, 2012 16:13:10

Message: 1 of 5

Hello, I'd like to create a GUI which enable the user to set variable in a model while it is running. But I'd like to enable the user, to see outport results while simulating. I'm not looking for a way to plot variables resulting from a simulation once the simulation has ended, but i'd like to do so WHILE the simulation is going on.

Can anyone help me, please? I manage to do the first part, but I can't find a way to plot variables while the simulation is going on...

Subject: How to plat variables in a GUI while simulating a model ?

From: Nasser M. Abbasi

Date: 4 Jul, 2012 16:20:32

Message: 2 of 5

On 7/4/2012 11:13 AM, Marius wrote:
>
> but I can't find a way to plot variables while the simulation is going on...
>

Just do plot any time you want to see current output? use
drawnow to flush the buffer

------------------
close all; clear all;
x=linspace(-pi,pi,100);
figure;
xlim([-pi pi]);
ylim([-1.1 1.1]);
hold on;
for i=1:length(x)
     %processing
     plot(x(i),sin(x(i)),'-o');
     drawnow;
     pause(0.1);
end
-----------------

--Nasser

Subject: How to plat variables in a GUI while simulating a model ?

From: dpb

Date: 4 Jul, 2012 16:21:20

Message: 3 of 5

On 7/4/2012 11:13 AM, Marius wrote:
...

> ... I can't find a way to plot variables while the simulation is
> going on...

See if

<http://www.mathworks.com/help/techdoc/creating_plots/f10-1460.html>

helps...

--

Subject: How to plat variables in a GUI while simulating a model ?

From: Phil Goddard

Date: 4 Jul, 2012 17:31:08

Message: 4 of 5

See the following blog for some ways,

http://blogs.mathworks.com/pick/2012/06/01/use-matlab-guis-with-simulink-models/

Phil.

Subject: How to plat variables in a GUI while simulating a model ?

From: Marius

Date: 5 Jul, 2012 07:25:23

Message: 5 of 5

Hi Phil, your answer is nice, it's exactly what' i'd like to do.
But i' have never done such a thing how does it work ?

"Phil Goddard" <phil@goddardconsulting.ca> wrote in message <jt1ukr$d07$1@newscl01ah.mathworks.com>...
> See the following blog for some ways,
>
> http://blogs.mathworks.com/pick/2012/06/01/use-matlab-guis-with-simulink-models/
>
> Phil.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
simulink Phil Goddard 4 Jul, 2012 13:34:12
plot simulink simu... Marius 4 Jul, 2012 12:14:08
rssFeed for this Thread

Contact us