How can delete specific values from below matrix?
23 次查看(过去 30 天)
显示 更早的评论
Hi.
I'd like to delete the columns from matrix distance which don't meet the condition inx.
Thanks.
for ig= 1:length(A)
distance(:,ig) = sqrt(abs(((A(:,1)-A(ig,1)).^2+(A(:,2)-A(ig,2)).^2)));
inx = distance>=50;
end
0 个评论
回答(1 个)
Dyuman Joshi
2019-12-15
To delete elements(columns here) from a matrix(distance) that don't meet a condition (distance>=50), you can do this
distance(distance<50)=[];
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
