The value assigned to variable <variable_name> might be unused
18 views (last 30 days)
Show older comments
please can any one solve these errors of some lines that have red underline because i am novice in matlab and i don't know the basics
here the code :
all of these lines have the same M-Lint warning "The value assigned to variable variable_name might be unused"
>> variable name which has red underline
thank you
1 Comment
Answers (3)
Walter Roberson
on 25 Dec 2013
On lines 4 and 7, add the comment
%#OK
at the end of the line.
Change line 12 to
fclose(Fid);
rather than being an assignment.
7 Comments
Image Analyst
on 27 Dec 2013
Edited: Image Analyst
on 27 Dec 2013
Spaces may be messing you up. MATLAB may be interpreting it as two different strings unless you wrap in single quotes. So instead of this:
Result = MatLab.Execute("cd D:\university\sem9\voicebox toolbox")
try this:
Result = MatLab.Execute("cd 'D:/university/sem9/voicebox toolbox'")
Also try forward slashes, which MATLAB and Windows are just fine with:
Result = MatLab.Execute("C:/Users/TOSHIBA/test2.m")
just in case it's using the backslash to indicate a special character like \t or \n.
Walter Roberson
on 27 Dec 2013
C:\Users\TOSHIBA\test2
is not a valid MATLAB command.
Use addpath() to add C:\Users\TOSHIBA to your MATLAB path, and then use
test2
Alternately, code
Result = MatLab.Execute("run('C:\Users\TOSHIBA\test2.m')")
3 Comments
Walter Roberson
on 27 Dec 2013
Result = MatLab.Execute("addpath('C:\Users\TOSHIBA');")
Result = MatLab.Execute("test2");
n
on 28 Dec 2013
Edited: n
on 28 Dec 2013
11 Comments
Walter Roberson
on 29 Dec 2013
Neither Image Analyst nor I have experience with that kind of audio work.
Have you now isolated the problem as being with your signal-processing and not with the VB to MATLAB interface? If so then it would be time to open a new third Question for the signal processing part.
See Also
Categories
Find more on Scope Variables and Generate Names in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!