Assigning dynamic variable in wokspace?
3 次查看(过去 30 天)
显示 更早的评论
i have made a dynamic variable by below command
eval(sprintf('new%d=[old_data]',old))
but not able to load the variable in workspace.Please help me this!!!!
0 个评论
回答(2 个)
Pritesh Shah
2016-10-8
Make sure that old_data is defined before using this commend. Also, old should be 1*1 matrix size. Scale.
old=1;
old_data=1:10;
eval(sprintf('new%d=[old_data]',old));
This should work !!
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!