![]() |
[求助]矩阵的某行设置为空集?
[SIZE="4"][SIZE="6"]a=[2:2:20;4:13;-3:3:24];
b=a>20; [m,n]=size(b); c=zeros(1,n); for i=1:m ip=isequal(c,b(i,:)) if islogical(ip)==1 a(i,:)=[];[SIZE="4"][SIZE="5"][/SIZE][/SIZE] end end 大家看一下 ,矩阵里面有大于20的数。程序就是找出来,并将这一行设置为空集。 我的怎么不能实现呀?[/SIZE][/SIZE] |
回复: [求助]矩阵的某行设置为空集?
a=[2:2:20;4:13;-3:3:24];
b=logical(any(a>20,2)); a(b,:)=[] 以上程序就可以满足要求 |
所有时间均为北京时间。现在的时间是 11:11。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.