split comma-separated rows into separate columns

hey i want to know how to split comma-separated rows into separate columns in cell array elements e.g.
x{4x1 cell}
x{1,1}{1,1}=[2,1,2,3]
& all other elements in this form.
result should be like this:
result{1,1}{1,1}=[2;1;2;3]
thanks in advance

댓글 수: 2

Are these "comma-separated rows" numeric vectors, or strings? From your description it is not clear what form or type the data has.
these have numeric value both positive and negative like 4 & -4

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

 채택된 답변

Stephen23
Stephen23 2017년 4월 14일
편집: Stephen23 2017년 4월 14일

0 개 추천

>> Z = cellfun(@(c)cellfun(@(v)v(:),c,'uni',0),x,'uni',0)
Z =
{1x1 cell}
>> Z{1}{1}
ans =
2
1
2
3
Although your code would be a lot simpler if you did not use nested cell arrays in the first place.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

2017년 4월 14일

댓글:

2017년 4월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by