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

1 visualizzazione (ultimi 30 giorni)
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 Commenti
Voss
Voss il 6 Mar 2024
Modificato: Voss il 6 Mar 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 il 7 Mar 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.

Accedi per commentare.

Risposta accettata

Voss
Voss il 6 Mar 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 Commento
Aditya
Aditya il 7 Mar 2024
Modificato: Aditya il 7 Mar 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.

Accedi per commentare.

Più risposte (0)

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by