Getting Blank Graph as Output

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;

 Risposta accettata

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 Commento

Ayush Roy
Ayush Roy il 16 Feb 2021
Thank you very much. Resolved. It was typing error.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by