I want to collect the first function and the second function but there is an error there is no help ('Xf ').
x=[-1 8 2 -3 -5 6 -4 5 -8 7 -9 4 5 -10 -6 -11 8 3 7 1 -5 -20 14 18 19 -16 8 16 -17 -15];
Xp=x(x>0);
Xn=x(x<0);
figure(1)
stem(Xn);
title('negative signal');
Xn=abs(Xn);
figure(2)
stem(x);
title('orginal signal');
figure(3)
stem(Xp);
title('positive signal');
figure(4)
stem(Xn);
title('abs negative signal');
Xf=Xp+Xn;

 採用された回答

Walter Roberson
Walter Roberson 2019 年 1 月 12 日

0 投票

Your Xp and Xn are different lengths. You cannot add them. And if you could, what would the answer mean ?

4 件のコメント

abdullah qasim
abdullah qasim 2019 年 1 月 12 日
I have a signal when I separate the positive signal from the negative signal as shown above
the matrixes dimension are diffrent
then must be transmitted this matrixes
Walter Roberson
Walter Roberson 2019 年 1 月 12 日
Okay, so transmit them. Just keep in mind they are different lengths.
You can concatenate them if you have reason to,
[Xn, Xp]
but you would need to keep track of the size of at least one of the two if you need to separate them out again.
abdullah qasim
abdullah qasim 2019 年 2 月 17 日
How can I keep track of the size of at least one of the two if I need to separate them out again?
Walter Roberson
Walter Roberson 2019 年 2 月 17 日
XNsize = length(Xn);
[XNsize, Xn, Xp]

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by