Adjust x-axis using 2 sliders in GUIDE

1 回表示 (過去 30 日間)
Chamath Vithanawasam
Chamath Vithanawasam 2018 年 8 月 2 日
I want to adjust the maximum and the minimum of a plot using two sliders, or any other alternative to that, the challenge is that the data that is plotted depends on x-axis values which are date and time, a piece of which is shown below. This data spans for months, so there is a lot of information.
DD.MM.YYYY hh:mm:ss;degC;degC
02.01.2018 00:00:16;29.78;30.54
02.01.2018 00:01:18;29.78;30.54
02.01.2018 00:02:19;29.78;30.54
02.01.2018 00:03:16;29.78;30.54
02.01.2018 00:04:18;29.78;30.54
02.01.2018 00:05:19;29.78;30.54
The data for the time along with the temperature readings are saved in a column using the following code format.
f = dir('*.log');
handles.alldatatable = [];
for ii = 1:numel(f)
DayFile = f(ii).name;
opts = detectImportOptions(DayFile);
opts = setvartype(opts,1,'datetime');
opts = setvaropts(opts,1,'InputFormat','dd.MM.uuuu HH:mm:ss');
table1 = readtable(DayFile,opts);
if isempty(handles.alldatatable)
handles.alldatatable = table1;
else
handles.alldatatable = [handles.alldatatable; table1];
end
end
How do I get two sliders to adjust datetime format values, one adjusting the minimum and the other adjusting the maximum points of the time in a plot?
  4 件のコメント
Jan
Jan 2018 年 8 月 3 日
It is a really bad idea to use the ApplicationData of the root object to store data. This has the same disadvantages as global variables. Use guidata to store the values inside the figure of the GUI.
Chamath Vithanawasam
Chamath Vithanawasam 2018 年 8 月 3 日
Understood, will try and make some changes.

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

回答 (1 件)

Jan
Jan 2018 年 8 月 2 日

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by