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 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Francesco Santoro
le 3 Juil 2020
Réponse apportée : Steven Lord
le 3 Juil 2020
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 commentaires
Réponse acceptée
Steven Lord
le 3 Juil 2020
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Digital Filtering dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!