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

Thread Subject:
very slow cell assignment to structure

Subject: very slow cell assignment to structure

From: LP

Date: 15 Mar, 2011 06:04:04

Message: 1 of 2

Hi

The following is output from my profiler

Time # Calls Line
< 0.01 14965 87 workingState.time = mktData.time;
  0.07 14965 88 workingState.price = obj.lastKnownPrice;
< 0.01 14965 89 x = mktData.FX.ids;
  2.56 14965 90 workingState.ids = x;
  
* Allarrays are numeric except 'x' which is a cell array of length(2).
* workingState Structure is *not* predefined (ie subfields being created here)

Any ideas how to speed this up and or whats going on?

Thanks, LP

Subject: very slow cell assignment to structure

From: Rune Allnor

Date: 15 Mar, 2011 06:15:06

Message: 2 of 2

On Mar 15, 7:04 am, "LP " <lylexxxx...@gmail.com> wrote:
> Hi
>
> The following is output from my profiler
>
> Time      # Calls   Line
> < 0.01   14965   87                 workingState.time     = mktData.time;
>   0.07   14965   88                 workingState.price    = obj.lastKnownPrice;                
> < 0.01   14965   89                 x = mktData.FX.ids;
>   2.56   14965   90                 workingState.ids      = x;
>
> * Allarrays are numeric except 'x' which is a cell array of length(2).
> * workingState Structure is *not* predefined (ie subfields being created here)
>
> Any ideas how to speed this up and or whats going on?

Cell arrays and structures are complicated beasts. There is a lot
going
on behind the scenes - memory managment and copying of elaborate book-
keeping structures - that will take time.

Forget about speed in such situations, if you are stuck with matlab.

Rune

Tags for this Thread

No tags are associated with this thread.

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.

Contact us