MATLAB: How can i plot positive magnitude only of a sine wave

app designer

i have been trying to plot the half positive of the sine wave without displaying the negative i couldnt find a way for it this is the function of the sine wave.
DC_Voltage = ((A) * sin((2)*(pi*F)*(T)+(Phase)));

Best Answer

% get the index of only positive values
idx = DC_Voltage>=0 ;
plot(DC_Voltage(idx))
Related Question