How to Pass Looping Array Cell Values in Java Method List

조회 수: 1 (최근 30일)
SAMEER ahamed
SAMEER ahamed 2014년 2월 22일
댓글: SAMEER ahamed 2014년 2월 22일
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