code for a delete button in matlab gui
古いコメントを表示
hello :) im doing a scientificcalculator GUI in Matlab, how can I code for a delete button for my calculator? its like deleting(just like backspace) characters from a static text box?
1 件のコメント
採用された回答
その他の回答 (2 件)
Jan
2012 年 9 月 30 日
Care for the empty input also:
screen = get(handles.text1, 'String');
if ~isempty(screen)
screen(end)='';
set(handles.text1, 'String', screen);
end
Matt J
2012 年 9 月 30 日
0 投票
In the callback for the delete button you would
(1) Read the string from the text box.
(2) Truncate the string like in the example below
(3) Write the truncated string back into the text box
>> str='myString'
str =
myString
>> str(end)='' %truncate
str =
myStrin
カテゴリ
ヘルプ センター および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
