|
"Kirk" <kwythers.nospam@umn.edu> wrote in message <j1rfc6$q41$1@newscl01ah.mathworks.com>...
> I have a bunch of structs in my workspace that I would like to rename by adding a tag onto the front of the struct name.
>
> Something like:
>
> old_x
> old_y
> old_z
>
> new_x
> new_y
> new_z
>
> I was looking for some way to use regular expressions to do this, but perhaps there is a better way. Any suggestions would be appreciated.
x = 'asfd'
y = 'asfdwerwe'
varNames = {'x','y'}
for i = 1:length(varNames)
varName = varNames{i};
assignin('base', ['new_' varName], evalin('base', varName))
end
|