MATLAB Answers

flip negative value as shown bellow

3 views (last 30 days)
abdullah qasim
abdullah qasim on 19 Sep 2019
Answered: Gokul Nayar on 19 Sep 2019
if
x=[1 2 -5 7 -9 4 -6 7 -6 8 -5 2 -1 5 -6 -8 -9 7 4 -1 ]
x + = if x(k) ≥ 0
0 otherwise
x-= if x(k) < 0
0 otherwise
. The positive signal x +(k) is transmitted in the first subframe .
the second subframe is used to carry the flipped (inverted polarity) signal −x −(k)
then send full signal

  4 Comments

Show 1 older comment
abdullah qasim
abdullah qasim on 19 Sep 2019
yes by using " if and otherelse "
or using another method
madhan ravi
madhan ravi on 19 Sep 2019
Post the attempted code.

Sign in to comment.

Accepted Answer

Gokul Nayar
Gokul Nayar on 19 Sep 2019
You question is not very clear to me, but for the first part of it, I belive you want to this:
x=[1 2 -5 7 -9 4 -6 7 -6 8 -5 2 -1 5 -6 -8 -9 7 4 -1];
y=x+(x>=0)*2-1

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.


Translated by