initialize a multidimensional matrix

Given two numbers: M, N, how to create a matrix: res = MxMxMxMxM...xM, where ndims(res) == N.

 Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 19 Fév 2014
Modifié(e) : Azzi Abdelmalek le 19 Fév 2014
N=6;
m=4;
A=zeros(repmat(m,1,n));

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by