Problem 42324. Accessing value of variable whose name is stored in another variable as string.
Accessing value of variable whose name is stored in another variable as string. for example: var1=n; var2='var1'; %Assigning var1 as a string var3= var2; %want to give var1 value to var3 with out using var1 variable.
% do not give var3=n or var3=var1l
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers46
Suggested Problems
-
Return the 3n+1 sequence for n
8087 Solvers
-
205 Solvers
-
255 Solvers
-
362 Solvers
-
Replace every 3rd element in a vector with 4
238 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!