function Sfm=My_AM_moulation1(fc,k,t,Sm);
% t=[0:0.001:1];
% Sm=cos(2*pi*fm*t); %Massage Signal%
t=input('time= ')
Ts=t(2)-t(1);
Fs=1/Ts
disp(['Ts=',num2str(FS)]);
msgbox('agar fc>fm va fc<.1/ts ')
fc=input('signal hamel= ');
if fc<0
    error('in frequency');
end
k=input('adad')
subplot(4,1,1);
plot(t,Sm);
xlabel('Time');
ylabel('Amplitude');
title('Massage Signal');
grid on ;

Sc=cos(2*pi*fc*t); %Carrier Signal%
subplot(4,1,2);
plot(t,Sc);
xlabel('Time');
ylabel('Amplitude');
title('Carrier Signal');
grid on ;

Sfm=(1+k*Sm).*Sc;  %AM Modoulation%
subplot(4,1,3);
plot(t,Sfm);
xlabel('Time');
ylabel('Amplitude');
title('AM Modoulation');
grid on ;