Error :Unexpected matlab operator ????

i linked speech recognition code in matlab with vb.net so when i call it from vb this message appear
this is the code
function test2 =test2()
clear;
[x,f]=audioread('C:\Users\TOSHIBA\father.wav');
extract=melcepst(x,f);
save( 'C:\Users\TOSHIBA\father.mat','extract');
[x1,f1]=audioread('C:\Users\TOSHIBA\color.wav');
extract2=melcepst(x1,f1);
save( 'C:\Users\TOSHIBA\color.mat','extract2');
Fid=fopen('C:\Users\TOSHIBA\path1.txt');
A=fscanf(Fid,'%u');
path=fscanf(Fid,'%s');
fclose=Fid;
[x,fsampling]=audioread(path);
pause(5);
x=fft(x);
fp=100;
fs=1000;
wp=2*fp/fsampling;
ws=2*fs/fsampling;
[N,wn]=buttord(wp,ws,1,5);
[b,a]=butter(N,wn);
y=filter(b,a,x);
soundsc((real(double(y))),fsampling)
[h,t]=impz(b,a);
N1=size(h,1);
n=1:N1;
extract=melcepst(y,fsampling);
if(A==1)
B1=importdata('C:\Users\TOSHIBA\father.mat');
d1=disteusq(extract,B1);
result1=int64(sum(sum(d1)));
if ((result1>=1517405)&&(result1<=3399480))
test='true';
else test='false';
end
end
if(A==2)
B2=importdata('C:\Users\TOSHIBA\color.mat');
d2=disteusq(extract,B2);
result2=int64(sum(sum(d2)));
if ((result2>=521370)&&(result2<=668471))
test='true';
else test='false';
end
end
so please what is the problem it can be :(

4 件のコメント

Walter Roberson
Walter Roberson 2013 年 12 月 24 日
You have
function test2 =test2()
The variable that you assign to should never be the same as the name of the function itself. Your function calculates "test" so probably that is the variable name you want on the left side.
n
n 2013 年 12 月 25 日
ya right Mr. , thank you very very much this line "function test2 =test2()" has been solved ,and still the same main error "Unexpected Matlab operator because of other errors of some lines that have red underline here :
so please can you solve these because i am novice in matlab and i don't know the basics
thank you again
n
n 2013 年 12 月 26 日
please anyone answer me :(
Walter Roberson
Walter Roberson 2013 年 12 月 26 日
There is no unexpected operator in that code. Please show more about how you are invoking the code.

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2013 年 12 月 26 日

0 投票

You can't do
fclose=Fid;
You need to do
fclose(Fid);

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

タグ

質問済み:

n
n
2013 年 12 月 24 日

コメント済み:

2013 年 12 月 26 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by