Adjust x-axis using 2 sliders in GUIDE

20 vues (au cours des 30 derniers jours)
Chamath Vithanawasam
Chamath Vithanawasam le 2 Août 2018
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 commentaires
Jan
Jan le 3 Août 2018
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 le 3 Août 2018
Understood, will try and make some changes.

Connectez-vous pour commenter.

Réponses (1)

Jan
Jan le 2 Août 2018

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by