Effacer les filtres
Effacer les filtres

how can i create "x" empty vectors to begin refill it?

1 vue (au cours des 30 derniers jours)
Erick Guzman
Erick Guzman le 16 Juin 2022
i wanna do something like, example:
p=input("please input the number of vector that you want:")
i dont know if use while or for to do this but, the important thing its create x vectors
x1=[ ];
x2=[ ];
x3=[ ];
...
xn=[ ];

Réponse acceptée

Steven Lord
Steven Lord le 16 Juin 2022
Can you dynamically create variables with numbered names like x1, x2, x3, etc.? Yes.
Should you do this? The general consensus is no. That Answers post explains why this is generally discouraged and offers several alternative approaches.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by