Struct contents reference from a non-struct array object `

7 vues (au cours des 30 derniers jours)
Sanjeev Kumar
Sanjeev Kumar le 12 Sep 2017
Commenté : Sanjeev Kumar le 13 Sep 2017
I'm converting a script into function and getting the following error:
Struct contents reference from a non-struct array object.
Error in button_callback_2 (line 16)
out=cellfun(@str2num,myData.toArray.cell,'un',0)';
Error while evaluating UIControl Callback.
The class of myData is a java.util.vector
Without making function, the script does the intended work.

Réponse acceptée

Image Analyst
Image Analyst le 12 Sep 2017
I don't know what myData is, but if it's an edit field on your GUI created with GUIDE, then to get the string in it, you can do
out = handles.myData.String;
Also, read this
  1 commentaire
Sanjeev Kumar
Sanjeev Kumar le 13 Sep 2017
Awesome!
the only thing that is to be changed was
out=cellfun(@str2num,myData.toArray.cell,'un',0)';
to
out=cellfun(@str2num,handles.Data.toArray.cell,'un',0)';
its working now.. Thank you very much!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur App Building 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!

Translated by