How to change variable name from known string?

26 ビュー (過去 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 Center および File ExchangeMATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by