i have matrix (2,n) i want to delete the columns that contain a value < 20 from the two rows for exmple: a=[3 4 7 20 35 40; 29 70 5 90 45 2] the output a=[20 35; 90 45] i tried this code but not work correctly
if true % code
enda=[3 4 7 20 35 40; 29 70 5 90 45 2]for i=1:size(a,1)for j=1:size(a,2)if (a(i)<20) a(:,i)=[];endendend
Best Answer