How to Pass Looping Array Cell Values in Java Method List

1 次查看(过去 30 天)
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 个评论
SAMEER ahamed
SAMEER ahamed 2014-2-22
编辑:SAMEER ahamed 2014-2-22
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
SAMEER ahamed
SAMEER ahamed 2014-2-22
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>

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Call Java from MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by