How to assign A or B or C to a Variable?

2 ビュー (過去 30 日間)
Reza
Reza 2015 年 12 月 19 日
編集済み: Stephen23 2019 年 6 月 19 日
Hi all; I have some variables and want to change their name. For example RSxi should change to RSai then it should change to RSbi In fact at any time A or B or C will assign to x in the variable name. Please help me? what can I do? Regards

採用された回答

Image Analyst
Image Analyst 2015 年 12 月 19 日
Assuming you already have a variable called RSxi, to rename it, you simply assign it to a new variable with your desired new name. Then you can clear the old variable if you want:
% Rename RSxi to RSai
RSai = RSxi;
clear('RSxi'); % If you want to get rid of old variable, clear it.
% Rename RSai to RSbi
RSbi = RSai;
clear('RSai'); % If you want to get rid of old variable, clear it.
  1 件のコメント
Reza
Reza 2015 年 12 月 20 日
Regards

サインインしてコメントする。

その他の回答 (2 件)

dpb
dpb 2015 年 12 月 19 日
You do NOT want to do this...for why and alternatives, see the FAQ How can I create variables?
  1 件のコメント
Reza
Reza 2015 年 12 月 20 日
Kind regards for your answer

サインインしてコメントする。


Stephen23
Stephen23 2015 年 12 月 19 日
編集済み: Stephen23 2019 年 6 月 19 日
  1 件のコメント
Reza
Reza 2015 年 12 月 20 日
Best Regards for your answer.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by