initialize a multidimensional matrix

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

Accepted Answer

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

More Answers (0)

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!