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

2 vues (au cours des 30 derniers jours)
Reza
Reza le 19 Déc 2015
Modifié(e) : Stephen23 le 19 Juin 2019
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

Réponse acceptée

Image Analyst
Image Analyst le 19 Déc 2015
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.

Plus de réponses (2)

dpb
dpb le 19 Déc 2015
You do NOT want to do this...for why and alternatives, see the FAQ How can I create variables?
  1 commentaire
Reza
Reza le 20 Déc 2015
Kind regards for your answer

Connectez-vous pour commenter.


Stephen23
Stephen23 le 19 Déc 2015
Modifié(e) : Stephen23 le 19 Juin 2019
  1 commentaire
Reza
Reza le 20 Déc 2015
Best Regards for your answer.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by