我想在Matlab中创建一个带有参数的函数:A,w0,omega,n1,nf
function A*cos(wb*n + omega) =fcosine(A,w0,omega,n1,nf)
n=n1:nf;
wb = w0;
xb = A*cos(wb*n + omega);
subplot(4,1,2), stem(n, xb)
grid
end
我正在努力做对,有什么想法吗?
答案 0 :(得分:1)
function xb = fcosine(A, w0, omega, n1, nf)
n = n1:nf;
wb = w0;
xb = A*cos(wb*n + omega);
subplot(4,1,2), stem(n, xb)
grid
end
但是你应该重新考虑一下你的Matlab function design。