about strings properties issstrprop

s= input('s: ');
isstrprop(s, 'alpha')
i wrote this code and it doesnt work. .How should i write. if i right Hello1234 as a input of s , i want to get 1 1 1 1 1 0 0 0 0 as an answer

 採用された回答

Rik
Rik 2020 年 5 月 20 日

0 投票

You forgot the 's' switch with your call to input:
s= input('s: ','s');
isstrprop(s, 'alpha')

2 件のコメント

Umut Oskay
Umut Oskay 2020 年 5 月 22 日
Can you explain what is the purpose of that ‘s’
Rik
Rik 2020 年 5 月 22 日
The documentation explains it already:
str = input(prompt,'s') returns the entered text, without evaluating the input as an expression.

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 5 月 20 日

0 投票

Remove the semi-colon.
isstrprop('saraaba123', 'alpha')

1 件のコメント

Umut Oskay
Umut Oskay 2020 年 5 月 20 日
sorry can you check the question again .

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

カテゴリ

タグ

質問済み:

2020 年 5 月 20 日

コメント済み:

Rik
2020 年 5 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by