I have a matrix of 1181*101 that is a Power of an electric vehicle. It has positive, negative and zeros. Now I need to choose minimum of positive from total matrix and maximum of negative from the same total matrix. How can I do it?
[P, index] = min(Power, , 2);
[P, index] = max(Power, , 2);
But every time, either it is taking only minimum or only maximum at a time. I tried changing negative terms to zero for minimum and positive terms to zero for maximum, but it still did not work. Please help me.
I can email to you if you require more details like code and variables.