initialize a multidimensional matrix

2 visualizaciones (últimos 30 días)
zhang
zhang el 19 de Feb. de 2014
Editada: Azzi Abdelmalek el 19 de Feb. de 2014
Given two numbers: M, N, how to create a matrix: res = MxMxMxMxM...xM, where ndims(res) == N.

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 19 de Feb. de 2014
Editada: Azzi Abdelmalek el 19 de Feb. de 2014
N=6;
m=4;
A=zeros(repmat(m,1,n));

Más respuestas (0)

Categorías

Más información sobre Multidimensional Arrays 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