Answered
How to get the index from a datetime array corresponding to a time duration?
There are many ways to do this, I bet. Here's one: >> bin = floor((t2 - t1) ./ minutes(5)) + 1; >> i2 = [find(diff(bin)>...

9 years ago | 0

Answered
Find missing days in a date vector matlab
Meriem, if you're using a version of MATLAB since R2014b, you might find using tables and datetimes make this pretty simple: ...

9 years ago | 0

Answered
Fill area in plot with datetime
Frank, if you have access to the most recent release, R2016b, area does now work with datetimes: area(X,Y); h = gca; h.X...

9 years ago | 1

Answered
importing excel file time format
In R2014b or later, assuming you have a cell array of strings for the date and a vector of doubles for the time, >> datetim...

9 years ago | 1

| accepted

Answered
express datetime from now, every 3h
In addition to Walter's suggestions, it may also be possible to take advantage of the roll-over behavior of the datetime constru...

9 years ago | 0

| accepted

Answered
How can I convert these numbers into a date for a table?
There's also an explicit conversion to datetime from numbers like that: >> data = table((20160105:101:20161101).','Variable...

9 years ago | 2

Answered
How to specify a default fill value for adding to table
Greg, it's really the double type that's doing the in-filling with zeros, not the table. In general, things in a table behave th...

9 years ago | 1

Answered
How can I store a table inside a matrix?
As Nidhikutty says, if you want to split data into hourly (?) tables and keep all of those in one container, you'll need to stor...

9 years ago | 1

Answered
Sorting time series data by category
Let's say you're starting with the spreadsheet version of something like this: Time,Species,Size,Direction 10/25/2016 10...

9 years ago | 0

| accepted

Answered
Converting a time field in a table to a usable format
Assuming you're starting out with something like this >> x = [1;2;3]; >> t = {'11:59:59:795'; '11:59:59:936'; '12:00:00:...

9 years ago | 2

| accepted

Answered
How to detect whether 72 hours have passed after the occurrence of a certain event? - datenum gives error for longer time series.
Unless you're using a version of MATLAB older than R2014b, you'll be much better off using datetimes: >> times = datetime(2...

9 years ago | 0

Answered
table dispaly with char array
You're using a char array, almost certainly not what you want for a variety of reasons. Mostly, char matrices require awkward pa...

9 years ago | 0

| accepted

Answered
How do I count the days of week in an hourly data set using datetime function?
Use dateshift, something like this: uniqueDays = unique(dateshift(dateNovLowVis,'start','day')) Then extract whatever co...

9 years ago | 0

| accepted

Answered
Table performance very slow
Byron, it's hard to make specific suggestions without knowing exactly what you're doing, but here are some thoughts. Tables a...

9 years ago | 0

Answered
Replace a missing string in a table
George's loop seems fine to me although you could tweak it a bit as for name = varNames var = A.name; if isce...

9 years ago | 1

Answered
getting data types of table
It seems like you want a list of the table's variable names, a list of the variable's types, and your 2xn cell array of names/ty...

9 years ago | 11

| accepted

Answered
Aligning Columns of a Table
Most likely that you need to use a fixed-width font in your command window. MATLAB's default is a fixed-width font, perhaps you ...

9 years ago | 1

Answered
mean value for every one minute and time blanks between
There are a variety of ways to do this, all more or less involving creating a grouping variable that says what minute each row o...

9 years ago | 0

Answered
How can I Stack data in a Table
There's a function specifically to do this: stack. In this case, you are stacking two groups of variables, so it's not quite as ...

9 years ago | 0

Answered
Multiple x axes with datetime time series
plotyy will work for plotting against datetimes (with some rough edges prior to R2016b), but it sounds like you want to overlay ...

10 years ago | 0

Answered
Converting time/dates to hours or number
This doesn't help the OP (sorry obstac) who's using R2008a, but the same calculation using datetime: >> t1 = datetime('13-S...

10 years ago | 1

Answered
How to average data for each sample (taken every ten minutes) from 4pm to 6am the next morning for each day for 2 months?
Lauren, I'm not clear what problem you're running into. If you have access to R2016b (available today, by coincidence), I rec...

10 years ago | 1

Answered
How to just select the date in a date-time excel upload.
ymd is a method of datetime to return the year, month, and day components as doubles. yyyymmdd is a method to return the (trunca...

10 years ago | 0

Answered
Convert dates from Excel to Matlab
If you're using R2014b or newer, suggest you look into using datetime, which has explicit conversions to and from excel serial d...

10 years ago | 0

Submitted


Mersenne Twister
Mersenne Twister uniform pseudo-random number generator.

10 years ago | 1 download |

5.0 / 5

Answered
Only one decimal place in a table object at the surface. How can I solve this problem?
Tables display with the same precision as the command window. Even in the command window, the only way to display exactly one de...

10 years ago | 0

Answered
how to convert data in UTC to a specific local time
UTC-5 is likely NOT your local time zone, since most locales shift for daylight saving. That's a detail many people forget. Y...

10 years ago | 8

| accepted

Answered
Merging CSV files with similar data structure into table
Bjorn, you can create a table with three variables, full of NaNs, and then just assign the variables you have read in from each ...

10 years ago | 0

| accepted

Answered
How can I find the average of Y values for a given X?
Two other possibilities that are very simple, using Azzi's example: 1) If you have R2013b or later, >> M = randi(10,100,...

10 years ago | 1

Answered
convert "Jul_26_2016__11-26-37_AM" to Date Vector
In R2014b or later, don't use datevec at all: >> s = {'Jul_26_2016__11-26-37_AM' 'Jul_26_2016__11-26-37_PM'} s = ...

10 years ago | 0

Load more