MATLAB: Flip signal (positive and negative)

Modulation

I need help to program a flip-signal to separate the negative signal from the negative and reverse it ?

Best Answer

I have no idea what you want, but take a look at flipping functions flipud() and fliplr(), as well as masking:
negIndexes = signal < 0;
negValuesOnly = signal(negIndexes); % Extract neg values only, or...
% Set negative values to zero (masking)
noNegatives = signal; % Initialize.
noNegatives(negIndexes) = 0; % Set negatives to zero, positives remain as-is.
% Reverse the signal horizontally
reversedSignal = fliplr(signal);
% Invert the signal vertically
signal = max(signal) - signal;