how to use string array in function?

1 visualización (últimos 30 días)
idan
idan el 12 de Jul. de 2022
Respondida: Prathamesh Kulkarni el 12 de Jul. de 2022
hello,
I would like to know how to input string arry into vector and matrix using function?
Thanks.
  5 comentarios
idan
idan el 12 de Jul. de 2022
yes, and also make that number into matrix and also (like you did) into vector.
Thanks
Dyuman Joshi
Dyuman Joshi el 12 de Jul. de 2022
Matrix? How? Give an example.

Iniciar sesión para comentar.

Respuestas (1)

Prathamesh Kulkarni
Prathamesh Kulkarni el 12 de Jul. de 2022
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

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by