MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [求助] ndims的问题。 (https://www.labfans.com/bbs/showthread.php?t=3545)

yclong8848 2008-06-10 20:56

[求助] ndims的问题。
 
请问: 一个矩阵的 ndims 是什么,为什么随便输入一个矩阵,他的ndims总是2呢?
什么叫一个矩阵的 维数啊? 我不懂。

谢谢!!

yclong8848 2008-06-11 16:09

自己顶下。

fgabertb 2008-06-13 10:06

ndims 指的是說 維度的個數

定義是
ndims(x) is length(size(x)).

像是2維矩陣的 ndims 就是2

3維矩陣的 ndims 就是3

此外

ndims(1)=2

這是因為雖然 1 是一個純量

但是matlab 他實際上是用 1 * 1的矩陣去存

所以也是2:smile:


所有时间均为北京时间。现在的时间是 05:22

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.