How to change variable name from known string?

조회 수: 4 (최근 30일)
Ivan Shorokhov
Ivan Shorokhov 2015년 7월 1일
편집: Stephen23 2019년 6월 27일
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".

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2015년 7월 1일
assignin('base',Old_var,'New_var')
  댓글 수: 1
Ivan Shorokhov
Ivan Shorokhov 2015년 7월 1일
Thank you, but another way around.
assignin('base','New_var', Old_var )

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by