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?

 採用された回答

Walter Roberson
Walter Roberson 2020 年 10 月 23 日

1 投票

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 件)

カテゴリ

ヘルプ センター および File ExchangeJava Package Integration についてさらに検索

製品

リリース

R2019a

質問済み:

FM
2020 年 10 月 23 日

編集済み:

FM
2020 年 10 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by