How to fill cell arrays with zeros to make them equal
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Joseph Lee
am 10 Dez. 2017
Bearbeitet: Walter Roberson
am 10 Dez. 2017
M=
{10x107}
{10x108}
{10x103}
{10x105}
how to fill each cell with zeros to reach the size of the max length cell
Gives
M=
{10x108}
{10x108}
{10x108}
{10x108}
0 Kommentare
Akzeptierte Antwort
Matt J
am 10 Dez. 2017
for i=1:numel(M)
M{i}(end,108)=0;
end
1 Kommentar
Walter Roberson
am 10 Dez. 2017
Bearbeitet: Walter Roberson
am 10 Dez. 2017
That will write 0 at M{2}(10,108) but that should not be changed.
for i=1:numel(M)
if size(M{i},2) < 108
M{i}(end,108)=0;
end
end
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Financial Toolbox 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!