Error Deleting column from cell

1 次查看(过去 30 天)
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