실행할 입력 인수가 추가적으로 필요합니다. 무엇을 넣어야 하나요? Additional input arguments are required to run. What should I put in?
조회 수: 6 (최근 30일)
이전 댓글 표시
function x = key2note(A, keynum, dur, fs)
tt = 0:(1/fs):dur-1/fs;
freq = 440 * 2^((keynum-49)/12);
x = A*cos(2*pi*freq*tt - pi/2);
...
위 코드를 실행하려고 하는데, 실행할 입력 인수가 추가적으로 필요하다고 합니다.
어떠한 값을 넣어야 하는 건가요?
I'm trying to execute the above code, but they need an additional input argument to execute.
What kind of value should I put in?
댓글 수: 0
답변 (1개)
Mohsen Aleenejad
2022년 12월 21일
Hi,
When you run the MATLAB script with:
function x = key2note(A, keynum, dur, fs)
tt = 0:(1/fs):dur-1/fs;
freq = 440 * 2^((keynum-49)/12);
x = A*cos(2*pi*freq*tt - pi/2);
You actually are creating a MATLAB function. You save it, so you can run it later and see the output. For that, you are gonna need to set some inputs, something like this:
if I have these values: A=1, keynum=50, dur=1, and fs is 1000, then I can run this command in MATLAB window for that:
>> key2note(1,50,1,1000)
Then it retuens the corresponding answer for me.
댓글 수: 0
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!