Insert zero columns in matrices inside a cell array

1 Ansicht (letzte 30 Tage)
Melody Lyu
Melody Lyu am 11 Feb. 2020
Kommentiert: Melody Lyu am 11 Feb. 2020
I have matrices inside the 23x1 cell that looks like this:
30x28 double
30x28 double
30x30 double
30x29 double
30x30 double
...
How do I add columns with zero at the end of the matrices so make all all of them 30x30?

Akzeptierte Antwort

Stephen23
Stephen23 am 11 Feb. 2020
Where C is your cell array:
for k = 1:numel(C)
C{k}(:,end+1:30) = 0;
end

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by