MATLAB Answers

0

How to Pass Looping Array Cell Values in Java Method List

Asked by SAMEER ahamed on 22 Feb 2014
Latest activity Commented on by SAMEER ahamed on 22 Feb 2014
Hi, I am new for matlab ,now i want to pass looping values to java method below i have tried my code , but i got error in matlab reference to be cleared variable ?please let me know where i have made mistake ? Below my Java Code :
if true
% code
public static void recordSample(List<Integer> points){
recordedSample.getMatrix().add(points);//Sample class object Getter Method
}
end
Below I have Matlab Code :
if true
% code
for i=1:20
matrix{1:i}=[33,22,6544,3335,23,544,5,2] %1-by-8 Matrix values
clear java;
import edu.lipreading.*;%Package
training = TrainingPanel;%Java Class
javaMethod('recordSample',training,matrix{1:i}); %Error reference to be cleared variable
end
end

  3 Comments

You forgot to paste the error message (ALL the red text).
Which i have got error like :
if true
% code
Reference to a cleared variable i.
Error in imqacdemo03>pb_liveread_Callback (line 385) javaMethod('recordSample',training,matrix{1,i});
if true
% code
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in imqacdemo03 (line 46) gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)imqacdemo03('pb_liveread_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback end end
Hi,
I am new for matlab , now i have 10 frames video file , each frame values i need to stored in xml file ?
I have Matlab Code Below like :
for i=1:10
matrix{1,i}=[leftx,lefty,rightx,righty,uppertx,uppery,bottomx,bottomy];%1-by-8 matrix
end
Below format i want to stored values please let me know how i can format like ?
example :
<reading>
<id>id1</id>
<matrix class="vector">
<vector>
<int>2</int>
<int>1</int>
<int>44</int>
<int>45</int>
<int>42</int>
<int>24</int>
<int>14</int>
<int>84</int>
</vector>
<vector>
<int>7</int>
<int>31</int>
<int>674</int>
<int>455</int>
<int>2</int>
<int>24</int>
<int>4</int>
<int>84</int>
</vector>
</matrix>
</reading>

Sign in to comment.

Tags

0 Answers