How to change variable name from known string?

4 visualizaciones (últimos 30 días)
Ivan Shorokhov
Ivan Shorokhov el 1 de Jul. de 2015
Editada: Stephen23 el 27 de Jun. de 2019
Given: I have variable "Old_var=55" and string "New_var".
Want: How to change name from Old_var to New_var by using code, so I will have new variable "New_var=55".

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 1 de Jul. de 2015
assignin('base',Old_var,'New_var')
  1 comentario
Ivan Shorokhov
Ivan Shorokhov el 1 de Jul. de 2015
Thank you, but another way around.
assignin('base','New_var', Old_var )

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by