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

 采纳的回答

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

3 个评论

Amit
Amit 2012-2-3
zeros(n,n,k) works.
Thanks Sean
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 2012-2-4
In Matlab vectors are 2D also, but one dimension is singelton.

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

产品

标签

Community Treasure Hunt

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

Start Hunting!

Translated by