how to make a number to vector?

Hello,
I would like to know how I can get a number from the user and make the numer to a vector?
Thanks.

 Accepted Answer

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 Comments

Thanks, its work:)
You're welcome!

Sign in to comment.

More Answers (0)

Categories

Asked:

on 8 Jul 2022

Commented:

on 8 Jul 2022

Community Treasure Hunt

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

Start Hunting!