Placing value in gui static text

조회 수: 4 (최근 30일)
hi  hey
hi hey 2017년 6월 15일
답변: Walter Roberson 2017년 6월 15일
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
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.

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by