how to use string array in function?

5 次查看(过去 30 天)
hello,
I would like to know how to input string arry into vector and matrix using function?
Thanks.
  5 个评论
idan
idan 2022-7-12
yes, and also make that number into matrix and also (like you did) into vector.
Thanks

请先登录,再进行评论。

回答(1 个)

Prathamesh Kulkarni
Hi Idan,
You can convert string array of numbers to vector by using str2double function.
A = ["34", "344", "23"]
A =
1×3 string array
"34" "344" "23"
>> B = str2double(A)
B =
34 344 23

类别

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