MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   如何在MATLAB中找到矩阵中的特定元素? (https://www.labfans.com/bbs/showthread.php?t=23773)

poster 2019-12-10 20:48

如何在MATLAB中找到矩阵中的特定元素?
 
我有一个数据集文件,其中有3列。

0 0 1 1 0 0 0 1 0 我已经将数据文件加载到MATLAB中,现在我想检查输出“ 1”在哪一列。

该文件的名称是:out.data

在第一行的第三列中显示“ 1”。如何在Matlab中编写它?



[B]回答:[/B]

output = [0 0 1 ; 1 0 0 ; 0 1 0]; [~,index] = max(output, [], 2) index = 3 1 2

[url=https://stackoverflow.com/questions/3454010]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 01:18

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