sum first matrix and second matrix

조회 수: 1 (최근 30일)
abdullah qasim
abdullah qasim 2019년 1월 12일
댓글: Walter Roberson 2019년 2월 17일
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일
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년 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개)

카테고리

Help CenterFile Exchange에서 Array and Matrix Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by