Effacer les filtres
Effacer les filtres

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.

2 vues (au cours des 30 derniers jours)
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

Réponses (1)

Image Analyst
Image Analyst le 1 Juin 2023
Try this:
v = [1; 2; 3+2i]
v =
1.0000 + 0.0000i 2.0000 + 0.0000i 3.0000 + 2.0000i
goodRows = imag(v) == 0
goodRows = 3×1 logical array
1 1 0
theMax = max(v(goodRows))
theMax = 2

Catégories

En savoir plus sur Elementary Math dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by