Matlab function takes 1 argument, Java caller provides 2

1 次查看(过去 30 天)
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?

采纳的回答

Walter Roberson
Walter Roberson 2020-10-23
  1 个评论
FM
FM 2020-10-23
编辑:FM 2020-10-23
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Java Package Integration 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by