Adjust x-axis using 2 sliders in GUIDE

1 visualización (últimos 30 días)
Chamath Vithanawasam
Chamath Vithanawasam el 2 de Ag. de 2018
Comentada: Chamath Vithanawasam el 3 de Ag. de 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 comentarios
Jan
Jan el 3 de Ag. de 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 el 3 de Ag. de 2018
Understood, will try and make some changes.

Iniciar sesión para comentar.

Respuestas (1)

Jan
Jan el 2 de Ag. de 2018

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by