Matlab function takes 1 argument, Java caller provides 2

The Mathworks page for an example makesqr.m shows a 1-argument function
% makesqr.m
%----------
function y = makesqr(x)
y = magic(x);
This gets generated into a Java package. However, the `step 16` of the Java invoker shows `makesqr` with *two* arguments.
result = theMagic.makesqr(1, n);
Can anyone please explain this difference in the number of arguments?

 Respuesta aceptada

Walter Roberson
Walter Roberson el 23 de Oct. de 2020

1 comentario

FM
FM el 23 de Oct. de 2020
Editada: FM el 23 de Oct. de 2020
Hi, Walter,
Thanks for that. The extra leading argument is also described at "Pass Arguments To and From Java". That page also describes how to accomplish multiple inputs/outputs.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Productos

Versión

R2019a

Preguntada:

FM
el 23 de Oct. de 2020

Editada:

FM
el 23 de Oct. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by