Matlab function takes 1 argument, Java caller provides 2

조회 수: 1 (최근 30일)
FM
FM 2020년 10월 23일
편집: FM 2020년 10월 23일
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