Do not put anything into the CreateFcn() functions of controls. If you want something to be initialized with a value, then put that value into the String property of the control in GUIDE, not in the CreateFcn.
Now, to get the value of a slider and put it in the text box as you move the slider, you'd put it into the callback function of the slider, not the callback of the text box.
function slider1_CallbackFcn(hObject, eventdata, handles)
value = handles.slider1.Value;
textLabel = sprintf('Slider = %.3f', value);
handles.text7.String = textLabel;
3 件のコメント
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/616308-dot-indexing-is-not-supported-for-variables-of-this-type-when-trying-to-write-value-into-static-text#comment_1064653
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/616308-dot-indexing-is-not-supported-for-variables-of-this-type-when-trying-to-write-value-into-static-text#comment_1064653
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/616308-dot-indexing-is-not-supported-for-variables-of-this-type-when-trying-to-write-value-into-static-text#comment_1064728
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/616308-dot-indexing-is-not-supported-for-variables-of-this-type-when-trying-to-write-value-into-static-text#comment_1064728
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/616308-dot-indexing-is-not-supported-for-variables-of-this-type-when-trying-to-write-value-into-static-text#comment_1065768
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/616308-dot-indexing-is-not-supported-for-variables-of-this-type-when-trying-to-write-value-into-static-text#comment_1065768
サインインしてコメントする。