Thread Subject:
alternative to eval(['model' num2str(st)]) and "num2str"

Subject: alternative to eval(['model' num2str(st)]) and "num2str"

From: Louis

Date: 22 Oct, 2010 17:16:04

Message: 1 of 3

Hello

I am using eval(['model' num2str(st) ']) extensively! is there any alternative? this shows as the bottleneck in my loop :(

my code goes as follow:
%%
X= is some image
for st=1:N
function(eval(['model' num2str(st) ']), X) % apply model on the image
end
%%

So profile tells me that "num2str" is the bottleneck but i am thinking of any alternative to num2str or the entire eval(...) statement in the code above?

Thank you

Louis

Subject: alternative to eval(['model' num2str(st)]) and "num2str"

From: Louis

Date: 22 Oct, 2010 17:34:06

Message: 2 of 3

Solved :) FAQ 4.6

Subject: alternative to eval(['model' num2str(st)]) and "num2str"

From: Louis

Date: 3 Mar, 2011 00:24:25

Message: 3 of 3

"Louis" wrote in message <i9shue$47u$1@fred.mathworks.com>...
> Solved :) FAQ 4.6


Hello Folks,

I could solve the problem in my original post of avoiding 'eval' using 'cell' by following FAQ4.6. Now I want to change the same code to 'c' using Matlab embedded toolbox; however, the embedded toolbox doesn't support 'cell'.

I am thinking of going back to use 'eval' however i am not sure whether 'eval' works with the embedded toolbox.

Any insight to workaround this issue would be appreciated,

Regards,

Louis

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
cell Louis 2 Mar, 2011 19:29:18
embedded toolbox Louis 2 Mar, 2011 19:29:18
faq_4point6 Matt Fig 22 Oct, 2010 13:46:16
code optimization Louis 22 Oct, 2010 13:19:31
eval Louis 22 Oct, 2010 13:19:31
num2str Louis 22 Oct, 2010 13:19:30
rssFeed for this Thread

Contact us