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 件のコメント
idan
idan 2022 年 7 月 8 日
Thanks, its work:)
Voss
Voss 2022 年 7 月 8 日
You're welcome!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePerformance and Memory についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by