Generate a Sine Wave in which I can change the sampling rate.

i wish to generate a basic sine wave and then plot it.
i then wish to take that basic sine wave and change the sampling rate (say from 1 to 10 to 100 to 1000 sampling points).
i do not have simulink. thanks.

 채택된 답변

Adriano Bittar
Adriano Bittar 2014년 8월 11일
편집: Adriano Bittar 2014년 8월 11일
%asks for sample rate
sample_rate = input('Type the sample rate:\n')
%time
t=0:2*pi/sample_rate:2*pi;
%discrete plot
stem(t,sin(t))

댓글 수: 3

awesome, thanks so much
would you know how to make the plot have an x-axis of 0-7 milliseconds and the y axis to have -30 to +50 millivolts?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink에 대해 자세히 알아보기

질문:

2014년 8월 11일

댓글:

2014년 8월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by