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.

추가 답변 (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 CenterFile Exchange에서 Introduction 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