Error in code: Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.
3 次查看(过去 30 天)
显示 更早的评论
function MOS=pesq(CleanSignal, DegradedSignal, rate)
% 1. Put clean and degraded wav files
% 2. build pesq from ITU source code (available on the ITU p.862) and
% generate pesq.exe
% 3. Put the pesq.exe in the current path
% 4. Use it like this exp. :
% MOS=pesq('CleanSignal.wav','DegradedSignal.wav','+8000')
% rate : Must select either +8000 or +16000.
%
[Return,strout]=system(['PESQ ',rate,' ',CleanSignal,' ',DegradedSignal, '']);
c=strfind(strout,'(Raw MOS, MOS-LQO):');
if isempty(c)
disp('Error!!!!!!!!');
MOS='It is not valid';
else
MOS_Raw=str2double(strout(c+23:c+28));
MOS_LQO=str2double(strout(c+29:end-1));
disp(' MOS_Raw MOS_LQO');
disp([MOS_Raw,MOS_LQO]);
MOS(1)=MOS_Raw;
MOS(2)=MOS_LQO;
end
I put the wav file and the rate in first line and i have this error: Error: File: pesq.m Line: 1 Column: 19
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To
construct matrices, use brackets instead of parentheses. How I can solve it?
0 个评论
采纳的回答
Steven Lord
2020-7-3
When you define your function, the function declaration line should include the names of the variables into which the input arguments will be stored.
When you call your function, specify the exact values on which you want your function to operate.
This is an incorrect way to define the addme function:
function z = addme(2, 3)
z = 2+3;
end
This is a correct way to define the addme function:
function z = addme(x, y)
z = x + y;
end
and this is a correct way to call the addme function.
theOutput = addme(2, 3)
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Digital Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!