Why array of strings are concatenated?
이전 댓글 표시
parameters=['K13','K24','K_52','K63','K74','K80','K101','K114','K162','MI','Ce','Ge','Pe'];
When I use:
size(parameters)
I get this:
ans =
1 39
But I wanted to get 1*13. I realized it concatenate all the strings to each other:
>> parameters
parameters =
'K13K24K_52K63K74K80K101K114K162MICeGePe'
How can I define it so that they become separated.
댓글 수: 2
Those are not strings, they are character vectors. Note the difference:
- "..." scalar string
- '...' character vector
String arrays and character arrays have very different properties and behaviors!
Star Strider
2019년 11월 4일
Note that string arrays were introduced in R2016b. Prior to that, strings and character arrays were considered to be the same thing.
채택된 답변
추가 답변 (1개)
ME
2019년 11월 4일
0 개 추천
You could just store this in a cell array instead - with one parameter inside each cell
카테고리
도움말 센터 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!