Community Profile

photo

Peter Perkins


MathWorks

938 total contributions since 2011

Peter Perkins's Badges

  • Guiding Light
  • 24 Month Streak
  • Thankful Level 1
  • Revival Level 2
  • Knowledgeable Level 4
  • First Answer

View details...

Contributions in
View by

Answered
Doing averages in blocks for downsampling time series data
A regular timetable and resample? >> tt = timetable(rand(12,1),'SampleRate',200) tt = 12×1 timetable Time Va...

3 days ago | 1

Answered
how to get hours of recorded data to 10 minutes time averaged data by moving averaging
It's not clear to me exactly what you want to do, but the following computes 10-minute binned means of timestamped data. >> tt ...

3 days ago | 0

| accepted

Answered
How to best store and work with timeseries datasets in Matlab?
MSani, you probably want to take a look at datastores, and tall (or not tall) timetables.

3 days ago | 1

Answered
Adding seconds to get new date
Andrew, it's not clear to me why you are converting datetimes to datevecs and then using etime. Not sure I've followed what you ...

3 days ago | 1

Answered
Need help transforming data from a table
Zac, if I understand correctly what you want to do, it's way simpler than all that. I assume you know that your data file is ki...

3 days ago | 0

| accepted

Answered
split timetable containing data from various dates
You may have a good reason for wanting to split up the data, but often it is not necessary, tools like findgroups/splitapply, va...

3 days ago | 0

Answered
Row & Column Operations in table
If the table is entirely numeric, t{:,:} = t{:,:} + 1 would also work, and may be more readable. But varfun will be more efficie...

3 days ago | 0

Answered
Trouble using retime to obtain 1 year of hourly average values from 15 years of hourly average values
Here's a sol'n that is along the lines of what Steve and Cris suggest, but uses varfun to create a table. I think groupsummary o...

9 days ago | 1

| accepted

Answered
Import CSV file using readtable gives wrong date time format.
Steven, I'm guessing that you are in the UK, and your system is set to US. Just a guess. You only give one line of your file, so...

9 days ago | 0

Answered
Find values in a table with multiple data types and set them to NA or NaN
I think standardizeMissing is the way to go here. It's "straight-forward" to do it explicitly >> t = table(["a";"b";"c"],[1;999...

9 days ago | 1

| accepted

Answered
Write cell array with multiple elements in the cell to Excel File
A cell array is not realluy a good choice for storing your data. Use a table, and use writetable to write out that "ragged" arra...

9 days ago | 0

Answered
Data manipulation problem?
Definitely move away from dlmread. fopen+textscan are very powerful, but just make more work in this case. Use readtable. You ...

11 days ago | 0

Answered
Create a table with Revenue by financial year such as 2017-18
I'm a little late to the party, but here's a version using rowfun and unstack. It doesn't require "balanced data", but maybe dpb...

11 days ago | 1

Answered
Shifting table entries based on criteria
This is in general a complicated question. You might have noisy data. You might have two different sample rates. It looks like m...

11 days ago | 0

| accepted

Answered
Remove rows from table when number in cell array is above certain value
I suggest you try using a categorical variable: >> test_table.Var1 = categorical(test_table.Var1,{'A-01' 'A-02' 'A-03'},'Ordina...

17 days ago | 0

Answered
convert .xlsx file into a timetable
readtable + table2timetable. If you are very up to date (R2019a), use readtimetable.

17 days ago | 1

Answered
Current system time as a Timestamp
This is an old post the got reopened. I feel compelled to say that in anything like recent versions of MATLAB, datetime('now') i...

25 days ago | 0

Answered
How to input a file and write timestamp of 2ms difference in to csv
It's not clear to me what your question really is, or how far you have gotten. The answer to your specific question about creati...

25 days ago | 1

Answered
WHY DATE CANNOT TRANSFER FROM EXCEL TO MATLAB BY XLSREAD?
As SS says, in recent versions of MATLAB, readtable should give you a table with a datetime and a duration for those columns in ...

25 days ago | 1

Answered
Finding average using two input condition from a table
Several ways to do this, including findgroups/splitapply, groupsummary, and varfun: >> XYZ = [ ... 1 1800 1.5 2 1900 ...

25 days ago | 0

| accepted

Answered
Obtaining contents of a column in a table corresponding to specific contents of another column in the same table
The original question you've asked only vaguely matches your second description of, "I wished to obtain values of col1 correspon...

25 days ago | 0

Answered
Inserting Timestamp into a Matrix
I'm gonna take a wild guess, because there's very little to go on here. I'm gonna guess you have format short, and you have a m...

28 days ago | 0

Answered
Reading in csv data with separate columns of dates and times into MATLAB R2017b.
Timothy, I'm on a newer version of MATLAB and readtable has "moved ahead", but I think this is close enough to what you want to ...

28 days ago | 1

Answered
How to get hourly mean values for each table ?
Matthew, I really can't tell what you are asking for, you need to give a short, clear example. retime on a timetable may be wha...

28 days ago | 0

Answered
how to create a time victor ?
How would you create any vector that long in MATLAB? You'd probably use the colon operator. Do that with time values. Pick your ...

29 days ago | 0

Answered
Comparing two tables and copy elements of table 2 into table 1
This is just an outer join: >> T1 = table(["hello";"new";"world";"hi";"hello";"hi"],[1;2;3;5;8;7],'VariableNames',["Word" "V"])...

1 month ago | 0

Answered
How do I compute 3 minute moving average in timeseries?
If you mean, "means for each 3-minute time window", consider using a timetable and the retime function. If you mean, "means at e...

1 month ago | 0

Answered
Error using table (line 253) All variables must have the same number of rows.
Psi0 = array2table(psi0(:,[1 6 11 16 21 16]) would have been helpful for this. And then addvars to add step at the beginning.

1 month ago | 0

Answered
Tables: Transform Variablenames
It's easy to turn 'x2_28_2019' into a datetime, that's just >> datetime('x2_28_2019','InputFormat','''x''MM_dd_yyyy') ans = ...

1 month ago | 0

| accepted

Answered
time string into seconds
I think StarStrider and Walter have already answered this, but in case things are not clear. Start from some text timestamps, ma...

1 month ago | 0

Load more