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=22499)

poster 2019-12-07 21:40

从Matlab的索引列表中获取矩阵的值列表
 
我有一个像这样的矩阵:

A = [35, 1, 6, 26; 3, 32, 7, 21; 31 9, 2, 22; 8, 28, 3, 17]; 以及这样的索引列表:

B = [1, 1; 1, 2; 2, 2; 1, 3]; 我想从矩阵A中获取带有B中索引的值列表

C = [35, 1, 32, 6] 我使用以下代码:

C = A(B==1) 但是C是:

[35, 3, 8, 1] 我哪里错了?请帮忙?



[url=https://stackoverflow.com/q/59226462]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 23:42

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