Placing value in gui static text
显示 更早的评论
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);
回答(1 个)
Walter Roberson
2017-6-15
0 个投票
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Entering Commands 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!