function [mextreme]=myextreme(Mloc,npl)mextreme=[];for p=2:npl-1 if abs(Mloc(p))>abs(Mloc(p+1))&& abs(Mloc(p))>abs(Mloc(p-1)) mextreme=[mextreme Mloc(p)]; endend
The result is get is:
mextreme = 0.0723mextreme = 0.0592mextreme = []mextreme = 0.0772mextreme = []
I want something looking like this:
mextreme=[0.0723 0.0592 0 0.0772 0]
How do I accomplish this?
Best Answer