Placing value in gui static text

4 vues (au cours des 30 derniers jours)
hi  hey
hi hey le 15 Juin 2017
Struct contents reference from a non-struct array object.
I built a gui to do a calculation when I press the start push button. I then wanted this value to display in a static text box. The issue is that when I press the start button the static wants the value at that moment but there isn't a value until the calculation is finished. How do I have the static box wait until the calculation is finished. (This is at least what I think the problem is, the value is not there when it ask for it).
The code for my static text box
average_weighted_elevation_factor = handles.awef;
set(handles.text11, 'String', average_weighted_elevation_factor);

Réponses (1)

Walter Roberson
Walter Roberson le 15 Juin 2017
No, if you are getting "Struct contents reference from a non-struct array object." somewhere in those two lines of code, then somehow your handles variable exists but is not a struct .
If you are using GUIDE, then there is a circumstance under which this can happen: namely that during the various CreateFcn callbacks, the handles variable has not yet been set up.
However, it does not sound as if you are putting this code into a CreateFcn callback, so something else is probably writing on top of your handles variable. We would need to see the code to say what is happening.

Catégories

En savoir plus sur Entering Commands 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