フィルターのクリア

GUIDE - Slider control table for new data

1 回表示 (過去 30 日間)
Ricardo Gutierrez
Ricardo Gutierrez 2017 年 1 月 30 日
コメント済み: Ricardo Gutierrez 2017 年 1 月 30 日
I want to control a table from a slider, that is, when increasing the number of the slider the elements of the table must be saved and the table must be empty for the input of new data. Can anybody help me?

回答 (1 件)

Jan
Jan 2017 年 1 月 30 日
You can insert the required code in the callback of the slider.
How did you create the GUI? By GUIDE or programatically? Do you know how to add a callback function to the slider? It would be easier to answer, if you post, what you have tried so far and ask a specific question.
A bold guess:
function MainGUI
handles.Fig = figure;
handles.Slider = uicontrol('style', 'slider', 'Position', [10, 10, 100, 15], ...
'Callback', @mySliderCB);
handles.Table = uitable('Position', [10, 40, 400, 200], 'Data', rand(4));
guidata(handles.Fig, handles);
end
function mySliderCB(SliderH, EventData)
handles = guidata(SliderH);
SliderUD = get(SliderH, 'UserData');
Value = get(SliderH, 'Value');
if ~isequal(SliderUD, Value) % Value has changed
Data = get(handles.Table, 'Data')
FileName = ??? % According to your needs
save(FileName, 'Data');
set(handles.Table, 'Data', cell(4));
end
  1 件のコメント
Ricardo Gutierrez
Ricardo Gutierrez 2017 年 1 月 30 日
Jan Simon,
I use the Guide controls.

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

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by