Dynamic Variable Name
Dynamic Variable Name
(OP)
Hi Guys,
I need to make this expression changes dynamically:
VariableX = importdata ('FilenameX.out');
where, everything is constant but the "X" is a integer number that changes from 1 to 5
for example: hello4 = impotdata ('file4.out');
Please Help Meeeeeeeeeee...
Thanks
I need to make this expression changes dynamically:
VariableX = importdata ('FilenameX.out');
where, everything is constant but the "X" is a integer number that changes from 1 to 5
for example: hello4 = impotdata ('file4.out');
Please Help Meeeeeeeeeee...
Thanks
RE: Dynamic Variable Name
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Dynamic Variable Name
CODE --> Matlab
Hope that heeeeeeeeeeelps.
RE: Dynamic Variable Name
You can use the "eval" function to construct variable variable names, but that gets you into a deep hole of confusion and terrible code.
Use cell arrays instead. Plenty of help and examples in the Matlab docs exist.
- Steve
RE: Dynamic Variable Name
Cheers
Greg Locock
New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?
RE: Dynamic Variable Name
CODE --> MATLAB