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

조회 수: 2 (최근 30일)
Erick Guzman
Erick Guzman 2022년 6월 16일
답변: Steven Lord 2022년 6월 16일
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=[ ];

채택된 답변

Steven Lord
Steven Lord 2022년 6월 16일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by