how to make a number to vector?

4 vues (au cours des 30 derniers jours)
idan
idan le 8 Juil 2022
Commenté : Voss le 8 Juil 2022
Hello,
I would like to know how I can get a number from the user and make the numer to a vector?
Thanks.
  1 commentaire
Torsten
Torsten le 8 Juil 2022
A number is an (1x1) vector.

Connectez-vous pour commenter.

Réponse acceptée

Voss
Voss le 8 Juil 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 commentaires
idan
idan le 8 Juil 2022
Thanks, its work:)
Voss
Voss le 8 Juil 2022
You're welcome!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Performance and Memory dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by