Error Deleting column from cell

조회 수: 1 (최근 30일)
kash
kash 2012년 9월 4일
r=
{6x4 cell}
{5x4 cell}
{4x4 cell}
{3x4 cell}
tried to delete the 3rd column but the third column was replaced by []
r = cell(size(r))
for jj = 1:numel(r)
r{jj}(:,[1:2,4]) = gene{jj}(:,[1:2,end]);
end

채택된 답변

Jan
Jan 2012년 9월 4일
편집: Jan 2012년 9월 4일
r = cell(size(r))
for jj = 1:numel(r)
r{jj} = gene{jj}(:, [1,2,4]);
end
With an explicite indices it would be:
r{jj}(:, 1:3) = gene{jj}(:, [1,2,4]);
But this is not required, because this is the default already.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Computational Geometry에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by