Borrar filtros
Borrar filtros

cell array contain zeros matrix

14 visualizaciones (últimos 30 días)
Pradya Panyainkaew
Pradya Panyainkaew el 20 de Dic. de 2017
Comentada: Michal Dudek el 27 de Feb. de 2020
How to create cell array size 1X100 which contain zeros matrix size 366X28 in each cell

Respuesta aceptada

Harish Ramachandran
Harish Ramachandran el 20 de Dic. de 2017
for i=1:100
a{i} = zeros(366,28);
end
Loop through each cell array block and insert a zeros matrix inside.
  3 comentarios
SM
SM el 11 de Feb. de 2020
Is it posible to solve the problem without using loop?
Michal Dudek
Michal Dudek el 27 de Feb. de 2020
Yes, it is possible. Use this code:
a = mat2cell(repmat(zeros(366,28),1,100),366,repmat(28,1,100));

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by