For Programmers: Free Programming Magazines  


Home > Archive > Matlab > March 2006 > increment workspace variable with eval funct.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author increment workspace variable with eval funct.
Stefan Goeckeritz

2006-03-31, 10:03 pm

Hey there,

I have to work with Matlab at work and have never done this before.
So right now, I write a script, that figures out how many recordet
steps in my raw data, taken from a force plate are.
It does that properly.
What I want to do right now is, writting variables to the ws with the
range of every step data.
Anyway, I do this with the eval function to increment the variables
neme..e.g. step_01, step_02, step_....
The incrementation is working properly, but when I want to put my
actual data in it, it won`t work. And I don`t have a clou what`s
going on.

Here`s the code:
-------------------------
for i=1:9
% produces the steps range data files step_0x
for j=step_start_data(i, 1):step_finish_data(i, 1)
step_temp(j-(j-1),1)=F2Z_SUM(j, 1)
end
step_string = ['step_0', int2str(i),' = step_temp'];
eval(step_string)

end
----------------------
The actual problem is the step_temp...Matlab thinks it`d be function
or stuff like that.
I don`t see the point :-(

Please give me a hand guys.

Greets Stefan
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com