I'm getting blank graph for the following code.......
clc
clear all;
fc=154000;
fm=fc/10;
fs=100^fc;
t=0:1/fs:4/fm;
xc=cos(2*pi*fc*t);
xm=cos(2*pi*fm*t);
figure(1)
subplot(2,1,1)
plot(t,xc);
xlabel('time(sec)');
ylabel('amplitude');
title('carrier signal of 154 khz')
grid on;

 채택된 답변

Walter Roberson
Walter Roberson 2021년 2월 16일

0 개 추천

fc=154000;
fm=fc/10;
fs=100^fc;
t=0:1/fs:4/fm;
xc=cos(2*pi*fc*t);
xm=cos(2*pi*fm*t);
figure(1)
subplot(2,1,1)
plot(t,xc);
xlabel('time(sec)');
ylabel('amplitude');
title('carrier signal of 154 khz')
grid on;
size(t)
ans = 1×2
1 0
size(xc)
ans = 1×2
1 0
fs
fs = Inf
If you are going to take 100^ something then you are going to overflow to infinity if the exponent is more than 154 (so 10^308 output)

댓글 수: 1

Ayush Roy
Ayush Roy 2021년 2월 16일
Thank you very much. Resolved. It was typing error.

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

추가 답변 (0개)

카테고리

질문:

2021년 2월 16일

댓글:

2021년 2월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by