Find dictionary entries with value type from Java
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Beatriz Sanchez
le 12 Juil 2019
Modifié(e) : Beatriz Sanchez
le 12 Juil 2019
Fangjun Jiang
le 12 Juil 2019
Modifié(e) : Fangjun Jiang
le 12 Juil 2019
The document has an example syntax
foundEntries = find(myEntryObjs,'-value','-class','Simulink.Parameter')
Réponses (1)
Donn Shull
le 13 Juil 2019
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")
0 commentaires
Voir également
Catégories
En savoir plus sur Schedule Model Components dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!