필터 지우기
필터 지우기

creating a function that plots sinewaves for different parameters.

조회 수: 1 (최근 30일)
EDEN
EDEN 2020년 11월 11일
답변: Setsuna Yuuki. 2020년 11월 11일
Hello,
i want to create a function that will plot sinewaves for different parameters. say one time i have 1Mhz the next time i have 1Khz. so i want to creat a function and call it anytime and pass the specific parameters.
thank you

답변 (1개)

Setsuna Yuuki.
Setsuna Yuuki. 2020년 11월 11일
%signal = autoWave(frecuency(Hz),amplitude)
signal = autoWave(5,2);
Function:
function [signal]=autoWave(frecuency,amplitude)
time = 0:1e-3:1
signal = amplitud*sin(2*pi*frecuency*time);
plot(time,signal,'linewidth',2);
xlabel('Time'); ylabel('Amplitude')
end

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by