Fihop
Fihop

Reputation: 3177

how to initialize a multidimensional array--matlab

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

Upvotes: 1

Views: 136

Answers (1)

Daniel
Daniel

Reputation: 36710

Generate the Array [M,M,M...] and pass it:

nan(repmat(M,1,N))

Upvotes: 3

Related Questions