how to make a number to vector?

조회 수: 2(최근 30일)
idan
idan 2022년 7월 8일
댓글: Voss 2022년 7월 8일
Hello,
I would like to know how I can get a number from the user and make the numer to a vector?
Thanks.
  댓글 수: 1
Torsten
Torsten 2022년 7월 8일
A number is an (1x1) vector.

댓글을 달려면 로그인하십시오.

채택된 답변

Voss
Voss 2022년 7월 8일
It's not clear what you want, but here's a way to get a number from the user and make a vector of its digits (assuming it's a positive integer):
number = input('Give me a number, user: ','s');
vector = number - '0';
  댓글 수: 2
Voss
Voss 2022년 7월 8일
You're welcome!

댓글을 달려면 로그인하십시오.

추가 답변(0개)

범주

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

태그

Community Treasure Hunt

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

Start Hunting!

Translated by