about strings properties issstrprop

1 次查看(过去 30 天)
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
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
Remove the semi-colon.
isstrprop('saraaba123', 'alpha')

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by