Start date and end date uipicker = Having issue to plot it on UI Axes using excel data of particular selected start and end date
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
So i have attached my excel file and app. I am trying to plot that data in ui axes which 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 . I am able to plot the data using list box but it plots all the data .I want to plot it of specific selected date.Plz anyone can help me out as it is my urgent project which needs to be submitted as early as possible.
Accepted Answer
Voss
on 12 Mar 2024
Please see the modified app attached.
In keeping with the existing design where the plot is updated when the Generate Plot button is pressed, I modified GeneratePlotButtonPushed to use the date pickers' Values and only plot data within the selected date range.
10 Comments
Aditya
on 13 Mar 2024
Thank you soo much Voss. The app is working great and it helped me a lot in my project. Got to know how to use date picker for my further projects too.
Thanks & Regards,
Aditya.
Voss
on 13 Mar 2024
You're welcome!
Aditya
on 15 Mar 2024
The app is running fine but just having one issue i am not able to plot all the values it plots 50 values which it selects on its own. Is it possible to all the values or the values we select???/
Voss
on 15 Mar 2024
I'm not sure what you mean. When I run it, if I don't select a start or end date, the app plots all the data.
The example data in the file you shared has dates going from March 1 to March 5, and that's what I see plotted when no start or end date is selected:

Aditya
on 16 Mar 2024
Yes you are right it plots all the data when date in date picker is not selected. But i am saying that i have a data of 5 march in which it has 60 value but after selecting the date in uidate picker it only plots 40 data which it selects on its own. I want to plot all the data or the data selected by myself. Did u get it what i am trying to say????
Thanks & Regarsds
Voss
on 16 Mar 2024
The data in Dhalipur.xls (confirm that is the file you are using) has 102 rows in total, with 43 rows corresponding to March 5, 2024. When you select start date = March 5, 2024 and end date = March 5, 2024, then those 43 rows are what is plotted. (I just ran the app and tested it.) You can put a breakpoint in GeneratePlotButtonPushed and step through the code to see which rows are plotted; check the values of start_idx and end_idx.
I have attached the screenshot. I want to say that the works it plots the data. But if i selec 5 th to 6th March then it plots on 50-55 data which it select on its own. You can check the screenshot. I want it to plot all the data in table . Is it possible???? Can you help me out with this.

Voss
on 18 Mar 2024
Here's what the app looks like for me when I make the same selections you have made:

Note:
- The x-axis goes from 09:13 to 09:19 on March 5, 2024 in my screen shot. The x-axis goes into March 6 on your screen shot. The data file I have only has data up to March 5, so I suspect you are using a different data set than I am.
- Your app window is resizeable, but mine is not, and the plot's xlabel is different in your screen shot vs mine, so I suspect you have changed the app.
How can I hope to fix any problems you have with the app if I am not running the same code with the same data? Please provide the actual app and actual data you are actually running.
Furhermore, I still don't see what the problem is, so I'd only be guessing even if I did have the same app and data. You say, "I want it to plot all the data in table." OK, then
- don't select a start or end date, or
- select a start date at or before the first date in the file and an end date at or after the last date in the file
Aditya
on 19 Mar 2024
Yes i got your point . I have attached my application with excel file and a screenshot. When i select 2 march to 6 march for an eg as shown in screenshot. It is plotting a total of 55-60 data the rest data is not being plotted.Even if i select direclty without the ui date picker it is not plotting all the data. So thats my issue did u get it.????????
Voss
on 19 Mar 2024
Thanks for the updated app and data file. I am able to reproduce your screen shot. I don't agree that it is plotting 55-60 data points. I find that all the data is being plotted. To be sure of this, I put a breakpoint in GeneratePlotButtonPushed and checked the values of start_idx and end_idx (exactly as I recommended you do in a previous comment); I found start_idx is 2 and end_idx is 123 which means 123-2+1 = 122 data points are plotted, which is everything in the file (ignoring the first row of app.t, which starts with NaT and is due to a blank row in the file immediately after the column names). What makes you say only 55-60 points are plotted?
Note that the data look like three spikes because there is only data within three relatively small time ranges: 02-Mar-2024 14:06-14:11 (~5 minutes), 05-Mar-2024 09:13-09:18 (~5 minutes), and 06-Mar-2024 17:10-17:24 (~14 minutes). When plotted against a range of several days, these brief few minutes where there is data look like narrow spikes, but if you zoom in horizontally you will see all the data is there.
More Answers (0)
Categories
Find more on Spreadsheets in Help Center and File Exchange
Tags
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)