フィルターのクリア

hslider=findobj('Tag', 'xText') returns 0x0 empty GraphicsPlaceholder array.

5 ビュー (過去 30 日間)
Ba Ba Black Sheep!
Ba Ba Black Sheep! 2017 年 9 月 30 日
コメント済み: Walter Roberson 2017 年 10 月 1 日
>> SliderTool
>> hslider=findobj('Tag', 'xText')
hslider =
0x0 empty GraphicsPlaceholder array.
>>
Why is this application giving this error?

採用された回答

Walter Roberson
Walter Roberson 2017 年 9 月 30 日
hslider = findobj(0, 'Tag', 'xText')
  4 件のコメント
Walter Roberson
Walter Roberson 2017 年 9 月 30 日
all_tag_objects = findall(0, '-property', 'tag');
all_tags = get(all_tag_objects, 'tag');
[tf, idx] = ismember('xText', all_tags);
if tf
fprintf('tag was found, object was\n');
all_tag_objects(idx)
else
fprintf('tag not found. Complete list of tags is:\n');
unique(all_tags)
fprintf('\n');
x_tag_names_cell = regexp(all_tags, '^x', 'match');
mask = ~cellfun(@isempty, x_tag_names_cell);
x_tag_names_cell = x_tag_names_cell(mask);
if isempty(x_tag_names_cell)
fprintf('No tags beginning with "x" were found\n');
else
fprintf('Tags beginning with "x" are:\n');
x_tag_names_char = char(x_tag_names_cell);
disp(x_tag_names_char)
fprintf('\nThe decimal equivalent of which is:\n')
disp(0 + x_tag_names_char)
end
end
Walter Roberson
Walter Roberson 2017 年 10 月 1 日
If you attach the .fig file, I will investigate.

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2017 年 9 月 30 日
Why not just say
hSlider = handles.xText;
that is, if you even need to use it at all, which you probably don't. You can get strings like this:
editBoxContents = handles.xText.String;
You can set strings like this:
handles.xText.String = 'Enter an x value here';

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by