How to extract a specific value within given range and row and column number which has a specific value.
1 回表示 (過去 30 日間)
古いコメントを表示
Just like the question, I want to extract row and column numbers.
example I want to find a closest value to 0.003 (there is no 0.003 in a matrix) in a n x 1 matrix.
How can I code it.
0 件のコメント
回答 (1 件)
Nobel Mondal
2015 年 10 月 2 日
>> randMatrix = (0.02*rand(5,1) - 0.01); % A random 5x1 matrix
>> [~, id] = min(abs(randMatrix - 0.003));
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!