MATLAB Answers

How can I find index of nearest value to specific number

13 views (last 30 days)
Farshid Daryabor
Farshid Daryabor on 26 Mar 2020
Commented: Farshid Daryabor on 26 Mar 2020
Please find attached file I want to find first index of arrays < 5 and then remove them from matrix (I want to filter arrays less than 5). I really appreciate any help.

  8 Comments

Show 5 older comments
Farshid Daryabor
Farshid Daryabor on 26 Mar 2020
function out_put=filter_specific_value(Mymatrix,filter_value)
newmatrix = reshape(Mymatrix,[],1);
[idx] = find(newmatrix<filter_value);
newmatrix(idx)=NaN;
out_put = reshape(newmatrix,size(Mymatrix));
end
Adam Danz
Adam Danz on 26 Mar 2020
I don't see any attachments. Is this question answered?

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!