I want to create vector of n by n zeros matrix from 1:k. How I can do. Plz help

 Akzeptierte Antwort

Sean de Wolski
Sean de Wolski am 3 Feb. 2012

1 Stimme

Huh?
doc zeros
Maybe:
zeros(n)
or
zeros(n,n,k)

3 Kommentare

Amit
Amit am 3 Feb. 2012
zeros(n,n,k) works.
Thanks Sean
Image Analyst
Image Analyst am 3 Feb. 2012
If that works, then we call that a 3D array, not a vector. I'd also call it a 3D matrix but I think some, like Steve Lord, consider a matrix as exactly 2 dimensions, no more and no less.
Jan
Jan am 4 Feb. 2012
In Matlab vectors are 2D also, but one dimension is singelton.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Produkte

Gefragt:

am 3 Feb. 2012

Bearbeitet:

T
T
am 28 Sep. 2013

Community Treasure Hunt

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

Start Hunting!

Translated by