Error using matlab.ui.control.EditField/set.Value (line 98) 'Value' must be a character vector or a string scalar.
조회 수: 20 (최근 30일)
이전 댓글 표시
I do simple App Designer to Circle/Sphere Calculations but I have error her
app.radius = app.EntertheradiusEditField.Value;
diameter = 2*app.radius;
[[[ app.ThediameterisEditField.Value = diameter;]]]
app.AreaEditField.Value=pi*app.radius^2;
app.CircumferenceEditField.Value =2*pi*app.radius;
app.VolumEditField.Value=(4/3)*pi*app.radius^3;
app.SurfaceEditField.Value=4*pi*app.radius^2;
Error using matlab.ui.control.EditField/set.Value (line 98)
'Value' must be a character vector or a string scalar.
댓글 수: 0
채택된 답변
Mario Malic
2020년 11월 15일
편집: Mario Malic
2020년 11월 15일
Hello,
The component EDITED app.EntertheradiusEditField.Value is probably a Text Field, which accepts only characters/array, replace it with the numeric field component.
I would suggest you to work through the example applications in App Designer and you'll understand how things work clearly.
댓글 수: 0
추가 답변 (1개)
Image Analyst
2020년 11월 15일
Try this:
app.ThediameterisEditField.String = num2str(diameter);
Same for the other edit fields. The contents of the edit text box are the "String" property of the control not the "Value" property.
댓글 수: 1
Mario Malic
2020년 11월 15일
Property Value is same for both styles of edit field component.
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!