initialize a multidimensional matrix

2 Ansichten (letzte 30 Tage)
zhang
zhang am 19 Feb. 2014
Bearbeitet: Azzi Abdelmalek am 19 Feb. 2014
Given two numbers: M, N, how to create a matrix: res = MxMxMxMxM...xM, where ndims(res) == N.

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Multidimensional Arrays 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!

Translated by