how to use string array in function?

조회 수: 1 (최근 30일)
idan
idan 2022년 7월 12일
답변: Prathamesh Kulkarni 2022년 7월 12일
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
Dyuman Joshi
Dyuman Joshi 2022년 7월 12일
Matrix? How? Give an example.

댓글을 달려면 로그인하십시오.

답변 (1개)

Prathamesh Kulkarni
Prathamesh Kulkarni 2022년 7월 12일
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