how to make a number to vector?

조회 수: 3 (최근 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
idan
idan 2022년 7월 8일
Thanks, its work:)
Voss
Voss 2022년 7월 8일
You're welcome!

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by