필터 지우기
필터 지우기

Is it a right conversion from java to matlab? I am getting error. I am new on matlab and confused on functions.

조회 수: 2 (최근 30일)
// Java code
public static void xp_system(int n,double t,double[x],int i){
// differential equation
k[1][i]= -3*x[2];
k[2][i]= (1/3)* x[1];
}
// matlab code
function xp(n,t,x,i)
int8 n;
k(1,i)=3*x(2); // too many input argument
k(2,i)=(1/3)*x(1); // too many input argument
end
  댓글 수: 3
Walter Roberson
Walter Roberson 2018년 4월 5일
k(1+1,i+1) = 3*x(2+1);
k(2+1,i+1) = (1/3) * x(1+1);
I suspect the code has a bug in it, but it is difficult to say as it does not declare k and does not appear to return anything.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Java Package Integration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by