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;

 Respuesta aceptada

Walter Roberson
Walter Roberson el 16 de Feb. de 2021
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 comentario

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

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 16 de Feb. de 2021

Comentada:

el 16 de Feb. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by