how to make a number to vector?

2 Ansichten (letzte 30 Tage)
idan
idan am 8 Jul. 2022
Kommentiert: Voss am 8 Jul. 2022
Hello,
I would like to know how I can get a number from the user and make the numer to a vector?
Thanks.

Akzeptierte Antwort

Voss
Voss am 8 Jul. 2022
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 Kommentare
idan
idan am 8 Jul. 2022
Thanks, its work:)
Voss
Voss am 8 Jul. 2022
You're welcome!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by