Dot indexing is not supported for variables of this type when trying to write value into static text box
Ältere Kommentare anzeigen
function text7_CreateFcn(hObject, eventdata, handles)
value=1;
set(handles.text7, 'String', num2str(value))
I am trying to add a value that will be determined by a slider in my GUI into the text of a static text box, but recieve the error message 'Dot indexing is not supported for variables of this type'
3 Kommentare
Samuel Leeney
am 16 Okt. 2020
Ameer Hamza
am 16 Okt. 2020
Is this created in App designer?
Samuel Leeney
am 17 Okt. 2020
Akzeptierte Antwort
Weitere Antworten (2)
Fangjun Jiang
am 16 Okt. 2020
Bearbeitet: Fangjun Jiang
am 16 Okt. 2020
set(hObject, 'String', num2str(value))
see this comment ?
% hObject handle to edit1 (see GCBO)
% handles empty - handles not created until after all CreateFcns called
4 Kommentare
Samuel Leeney
am 17 Okt. 2020
Samuel Leeney
am 17 Okt. 2020
Rik
am 17 Okt. 2020
No, set(hObject,'String',num2str(value)).
Using a programmatic GUI (and not AppDesigner) offers a wide variety of benefits. I would encourage you to check out the thread I linked in my previous comment.
Walter Roberson
am 17 Okt. 2020
function text7_CreateFcn(hObject, eventdata, handles)
value = 1;
set(hObject, 'String', num2str(value))
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!