请问代码demodulat=modulator_cor(signal_rev,fs,fc,ft,M); %相关解调模块
调用 "c>modulator_cor" 时,未对输出参数 "demodulat" (可能还包括其他参数)赋值。
应该怎么解决
在调用函数 modulator_cor 时出现了输出参数未赋值的错误。这可能是因为在定义函数 modulator_cor 时没有给出输出参数的默认值,或者在函数内部没有对输出参数进行赋值。
为了解决这个问题,需要在定义函数 modulator_cor 时给出输出参数的默认值,或者在函数内部对输出参数进行赋值。
例如,在定义函数时给出输出参数的默认值:
function demodulat = modulator_cor(signal_rev,fs,fc,ft,M, demodulat = 0)
% 函数体
end
在函数内部对输出参数进行赋值:
function demodulat = modulator_cor(signal_rev,fs,fc,ft,M)
% 函数体
demodulat = 0;
end
在修改完函数定义之后,重新运行代码,应该就能正常调用函数 modulator_cor 了。