필터 지우기
필터 지우기

Separating a column in two others when there are empty cells

조회 수: 1 (최근 30일)
antonet
antonet 2012년 6월 21일
Guys,
I have the following cell Column
' '
'4W231108'
'4W211208'
'4W180109'
'4W150209'
'4W150309'
'4W120409'
AS you can see the first element of the above column is empty
and I want to obtain Column 1 column 2
“ ” ““
'4W 231108'
'4W 211208'
'4W 180109'
'4W 150209'
'4W 150309'
'4W 120409'
Any suggestions?
thanks

채택된 답변

Sean de Wolski
Sean de Wolski 2012년 6월 21일
How about this hideous idea?
C = {''; '4W231108' ; '4W211208' ; '4W180109' ; '4W150209' ; '4W150309' ; '4W120409'}
C2 = cellfun(@(x)[{x(1:min(numel(x),2))} {x(3:end)}],C,'uni',false);
C2 = vertcat(C2{:});
  댓글 수: 8
Sean de Wolski
Sean de Wolski 2012년 6월 21일
Well did you copy C in ?
antonet
antonet 2012년 6월 21일
what do you mean?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by