I have a matrix with elements both real and complex.I want to find Max value within a column of that matrix ,,ignoring all the complex element in that column.
1 回表示 (過去 30 日間)
表示 古いコメント
Eg. If in a particular column of matrix suppose elements are ( 1 ,2 ,3+2i) then I want to find the max ignoring (3+2i) means my answer should be 2
0 件のコメント
回答 (1 件)
Image Analyst
2023 年 6 月 1 日
Try this:
v = [1; 2; 3+2i]
goodRows = imag(v) == 0
theMax = max(v(goodRows))
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!