Matlab function takes 1 argument, Java caller provides 2

1 visualizzazione (ultimi 30 giorni)
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?

Risposta accettata

Walter Roberson
Walter Roberson il 23 Ott 2020
  1 Commento
FM
FM il 23 Ott 2020
Modificato: FM il 23 Ott 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.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Java Package Integration in Help Center e File Exchange

Prodotti


Release

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by