Borrar filtros
Borrar filtros

Having issue in Start date and end date picker to plot data to graph from excel data

1 visualización (últimos 30 días)
So i have attached my excel file and app. I am trying to plot that data in ui axes with i am not able to plot it . I have tried using uidate picker as i want to plot specific data of some specific date. Plz guide me with program how can i write it and how i can plot it in uiaxes.I am having issues using using uidate picker after even after reading its specification . Plz anyone can help me out as it is my urgent project which needs to be submitted.
Thanks Regards
  2 comentarios
Voss
Voss el 6 de Mzo. de 2024
Editada: Voss el 6 de Mzo. de 2024
Have you gotten the app to work without the uidatepickers yet? I mean, are you able to load a file, select columns, and plot all of their data (without regard to the start/end date, just plotting all the selected columns' data)?
It doesn't work for me when I try it, so if I were you, I would get that working first and then try to get the uidatepickers working.
The problem I ran into is that table app.t's columns are all cell arrays of character vectors. You cannot plot a cell array; you'll either have to modify the readtable call to give you a table containing something you can plot, or convert the app.t's contents to some plottable class (numeric or datetime in this case) at some point - either when you first load the file or just before you plot.
Aditya
Aditya el 7 de Mzo. de 2024
Thankyou soo much for the advice. I have changed the code and now It works properly now with the given excel file i am able to plot the grapgh. Can you help me with how do i do it with date picker to plot the data??? It will help me to do my project quickly.
I have changed the code so plz check and can you help me out with the date picker to plot data from start and end date.
Its a little bit urgent soo your little time can help me a lot.
Thnaks Regards.

Iniciar sesión para comentar.

Respuesta aceptada

Voss
Voss el 6 de Mzo. de 2024
Here's one way to get the table app.t to contain data in a form that's convenient for plotting, rather than cell arrays of character vectors.
% Read the Excel data
filename = fullfile(app.folder,filename);
opts = detectImportOptions(filename); % get the import options for this file;
opts.VariableTypes{1} = 'datetime'; % tell readtable the first column is datetime
opts.VariableTypes(2:end) = {'double'}; % and the rest are double, and
app.t = readtable(filename,opts); % read the file
Of course this assumes that the first column of the file is datetime and the other columns are numeric, which may not always be the case.
Modify your calls to readtable as above, and you'll be able to make some plots.
  1 comentario
Aditya
Aditya el 7 de Mzo. de 2024
Editada: Aditya el 7 de Mzo. de 2024
Thankyou soo much. It works properly . Can you help me with how how do i do it with date picker to plot the data??? It will help me to do my project quickly.
I have changed the code so plz check and can you help me out with the date picker to plot data from start and end date
Thnaks Regards.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by