Find dictionary entries with value type from Java

조회 수: 1 (최근 30일)
Beatriz Sanchez
Beatriz Sanchez 2019년 7월 11일
답변: Donn Shull 2019년 7월 13일
Hi,
I am trying to execute from Java and through the feval function the following command:
engine.feval("find",dictionarySectionHandle, "-value", "-class", "Simulink.Parameter");
However I get the following error:
find.
'-value' is not a valid option to findobj.
In the documentation [Find Function] it specifies that we should call the find function on the list of entries but I have tested the function in MATLAB's command line (as follows) and it works fine.
find(dictionarySectionHandle, '-value','-isa', 'Simulink.Parameter')
What am I doing wrong?
Thanks
  댓글 수: 3
Beatriz Sanchez
Beatriz Sanchez 2019년 7월 12일
편집: Beatriz Sanchez 2019년 7월 12일
Thanks Fangjun,
Unfortunately, excuting with
find(dictionarySectionHandle, 'value','-isa', 'Simulink.Parameter')
still complains with the following error:
Error using Simulink.data.dictionary.Section/find
Incomplete parameter-value pair.
Fangjun Jiang
Fangjun Jiang 2019년 7월 12일
편집: Fangjun Jiang 2019년 7월 12일
The document has an example syntax
foundEntries = find(myEntryObjs,'-value','-class','Simulink.Parameter')

댓글을 달려면 로그인하십시오.

답변 (1개)

Donn Shull
Donn Shull 2019년 7월 13일
It appears that MATLAB is converting the java String arguments to MATLAB strings which is causing the error for example the pure MATLA, B command:
feval("find", dictionarySectionHandle, "-value", "-class", "Simulink.Parameter")
Error using Simulink.data.dictionary.Section/find
'-value' is not a valid option to findobj.
Produces the same error that your engine command does, while:
feval("find", dictionarySectionHandle, '-value', "-class", "Simulink.Parameter")
ans =
3×1 Entry array with properties:
Name
DataSource
LastModified
LastModifiedBy
Status
works. You might try the using:
valueArg = engine.feval('char', "-value");
engine.feval("find", dictionarySectionHandle, valueArg, "-class", "Simulink.Parameter")

카테고리

Help CenterFile Exchange에서 Schedule Model Components에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by