Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Reference to a cleared variable
Replies: 4   Last Post: Feb 28, 2014 2:57 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Yair Altman

Posts: 1,352
Registered: 3/19/07
Reference to a cleared variable
Posted: Feb 24, 2014 3:58 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"SAMEER ahamed" <sameersoft6@gmail.com> wrote in message <leece7$4h2$1@newscl01ah.mathworks.com>...
> Hi,
>
> I am newbie for Mat-lab , now i want to from mat-lab pass values to java method .
> Below My Java Code :
> public static void sampleTest(int width ,int height ,List<Integer> points){
> Sample recordedSample = new Sample ();
> recordedSample.setHeight(height);
> recordedSample.setWidth(width);
> recordedSample.getMatrix().add(points);
> }
> Below My Mat-lab Code :
> %From My 10 frames Video file read
> width =vidobj.width;
> height =vidobj.height;
> for int i=1:10
> matrix{1,i}=[3,2,,4,2,4,3,2,4];%Dynamic values 1-by-8 matrix
> end
> clear java;
> import edu.lipreading.*;
> training = TrainingPanel;
> javaMethod('recordSample',training,int32(width),int32(height),matrix{1,i});
>
> Result :When I have run my Mat-lab code i got Error like :
> Reference to a cleared variable width.
>
> Error in imqacdemo03>pb_liveread_Callback (line 445)
> javaMethod('recordSample',training,int32(width),int32(height),matrix{1,i});



Unfortunately, the "clear java" command has the effect of clearing the workspace, including the width and height vars. Simply delete this command, you don't need it.

Yair Altman
http://UndocumentedMatlab.com
Read my Matlab-Java programming book



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.