Thread Subject: matlab multiprocessing

Subject: matlab multiprocessing

From: yohee yohee

Date: 11 Mar, 2010 23:26:02

Message: 1 of 3

Hi,
I have a simulation scheme in Simulink which periodically calls m-file (block MATLAB Fcn).
In the m-file an image is loaded from IP camera and processed. The result is send back to simulink scheme and used for controlling a model.

My problem is that loading from IP cam takes a lot of time. It is quicker to read it from HDD. I would like to have a parallel loop where an image would be loaded from IP cam repeatedly and saved to HDD as a jpg file. Nothing more.
Then in Simulink scheme I would read the last picture saved to HDD and process as i described above.

I have read something about multiprocessing but ...no idea. I would appreciate some code sample. It would be the best... Thanks.

Subject: matlab multiprocessing

From: Ashish Uthama

Date: 12 Mar, 2010 14:43:02

Message: 2 of 3

On Thu, 11 Mar 2010 18:26:02 -0500, yohee yohee <yohee@seznam.cz> wrote:

> Hi,
> I have a simulation scheme in Simulink which periodically calls m-file
> (block MATLAB Fcn).
> In the m-file an image is loaded from IP camera and processed. The
> result is send back to simulink scheme and used for controlling a model.
>
> My problem is that loading from IP cam takes a lot of time. It is
> quicker to read it from HDD. I would like to have a parallel loop where
> an image would be loaded from IP cam repeatedly and saved to HDD as a
> jpg file. Nothing more.
> Then in Simulink scheme I would read the last picture saved to HDD and
> process as i described above.
>
> I have read something about multiprocessing but ...no idea. I would
> appreciate some code sample. It would be the best... Thanks.

I am a bit unfamiliar with calling MATLAB functions from Simulink.

If you have the Parallel computing toolbox, maybe you could use BATCH?

Subject: matlab multiprocessing

From: yohee yohee

Date: 12 Mar, 2010 20:29:20

Message: 3 of 3

"Ashish Uthama" <first.last@mathworks.com> wrote in message <op.u9glt0e6a5ziv5@uthamaa.dhcp.mathworks.com>...
> On Thu, 11 Mar 2010 18:26:02 -0500, yohee yohee <yohee@seznam.cz> wrote:
>
> > Hi,
> > I have a simulation scheme in Simulink which periodically calls m-file
> > (block MATLAB Fcn).
> > In the m-file an image is loaded from IP camera and processed. The
> > result is send back to simulink scheme and used for controlling a model.
> >
> > My problem is that loading from IP cam takes a lot of time. It is
> > quicker to read it from HDD. I would like to have a parallel loop where
> > an image would be loaded from IP cam repeatedly and saved to HDD as a
> > jpg file. Nothing more.
> > Then in Simulink scheme I would read the last picture saved to HDD and
> > process as i described above.
> >
> > I have read something about multiprocessing but ...no idea. I would
> > appreciate some code sample. It would be the best... Thanks.
>
> I am a bit unfamiliar with calling MATLAB functions from Simulink.
>
> If you have the Parallel computing toolbox, maybe you could use BATCH?

I have a model in Simulink with block called MATLAB Fcn. There it is possible to fill in the m-file script name. The script is a function with one input param. and one output param.

Tags for this Thread

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.

rssFeed for this Thread

Contact us at files@mathworks.com