how to use string array in function?
Mostra commenti meno recenti
hello,
I would like to know how to input string arry into vector and matrix using function?
Thanks.
5 Commenti
Dyuman Joshi
il 12 Lug 2022
What exactly are you trying to do? Do you have any code? any error? Show us.
What you have mentioned here is quite vague to give any proper answer.
idan
il 12 Lug 2022
Dyuman Joshi
il 12 Lug 2022
So, for example, if the input is ["12345" "2" "69"]
the output should be [12345 2 69]?
idan
il 12 Lug 2022
Dyuman Joshi
il 12 Lug 2022
Matrix? How? Give an example.
Risposte (1)
Prathamesh Kulkarni
il 12 Lug 2022
0 voti
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
Categorie
Scopri di più su Characters and Strings in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!