Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Reducing lag caused by masked Simulink blocks

Asked by Craig on 14 Jan 2013

Hi all,

I have a problem where the images (that are actually useful) rendered on Simulink blocks seem to lag Simulink in the sense that:

1. Scrolling through the model is grindingly slow.

2. When running the model it seems to force re-render all the mask images.

I use this method:

image(imread('useful_image.jpg'));

Does anyone know of a more efficient way of doing this?

Craig

2 Comments

Kaustubha Govind on 14 Jan 2013

Craig: Please contact MathWorks Tech Support for this question if you don't receive a response here. Thanks!

Ryan G on 14 Jan 2013

How big are the image files?

Craig

Tags

Products

1 Answer

Answer by Guy Rouleau on 14 Jan 2013
Accepted answer

One thing I like to do is storing the image data in the block user data.

I do not guarantee it will lead to great improvement, but it will save the call to IMREAD, replacing it by a get_param of the block user data.

It will make your model file bigger, but you will not need to carry image files anymore.

As Ryan point out, always make sure the size of the image reasonnable (you do not need 1024x768 pixels for a small block)

0 Comments

Guy Rouleau

Contact us