MATLAB: Getting Blank Graph as Output

MATLABMATLAB Online Serverplotsignal

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;

Best Answer

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)
Related Question