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 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by