Placing value in gui static text
5 ビュー (過去 30 日間)
古いコメントを表示
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);
0 件のコメント
回答 (1 件)
Walter Roberson
2017 年 6 月 15 日
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Entering Commands についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!