how to handle 'nested' arrays
이전 댓글 표시
Hello, I am new to MatLab, and am having a problem with code like this:
x=["bar" "foobar" "food" "bard"];
y=regexp(x,'.*foo.*','match');
X is a string array, but the problem is y seems to be a cell array of string arrays- which I can't manipulate or use at all. So what I want to do is "simplify" y so that it is also a simple string array, by taking the first element of each element of the cell array. I.E., output should look like:
["" "foobar" "food" ""]
Any general references on how to handle and manipulate nested arrays of arrays would also be appreciated.
채택된 답변
추가 답변 (1개)
jean claude
2017년 10월 9일
편집: jean claude
2017년 10월 9일
0 개 추천
hi maho, i didn't understand what do you want exactly, but you can read here https://www.mathworks.com/help/matlab/ref/strsplit.html may be it helps!
카테고리
도움말 센터 및 File Exchange에서 Text Data Preparation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!