Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
// 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 comentarios
Walter Roberson
Walter Roberson el 5 de Abr. de 2018
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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Java Package Integration en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by