Effacer les filtres
Effacer les filtres

cell array contain zeros matrix

11 vues (au cours des 30 derniers jours)
Pradya Panyainkaew
Pradya Panyainkaew le 20 Déc 2017
Commenté : Michal Dudek le 27 Fév 2020
How to create cell array size 1X100 which contain zeros matrix size 366X28 in each cell

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by