Vectors must be the same lengths.

조회 수: 4 (최근 30일)
tariq almalki
tariq almalki 2017년 1월 3일
댓글: Star Strider 2017년 1월 4일
Hi guys I am trying to add a white Gaussian noise to FM signal
this is my code fc = 20; %Carrier Frequency fs = 1000; %Signal Frequency t = 0:0.00001:0.002; x = 2*cos(2*pi*t)-3*sin(2*pi*2*t); dev = 50; y = fmmod(x,fc,fs,dev); r = awgn(x,10,'measured'); plot(t,[y r]) legend('Original Signal','Signal with AWGN')
but i got this error "Vectors must be the same lengths".
can you help me ?

채택된 답변

Star Strider
Star Strider 2017년 1월 3일
Try this instead:
plot(t,[y; r])
The (;) creates a (2xN) matrix that plot will accept.
  댓글 수: 2
tariq almalki
tariq almalki 2017년 1월 4일
very good , thanks
Star Strider
Star Strider 2017년 1월 4일
My pleasure.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Measurements and Feature Extraction에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by