Community Profile

photo

Peter Perkins

MathWorks

Last seen: Today Active since 2011

Statistics

All
  • Personal Best Downloads Level 1
  • 5-Star Galaxy Level 3
  • First Submission
  • 36 Month Streak
  • Guiding Light
  • Thankful Level 1
  • Revival Level 2
  • Knowledgeable Level 4
  • First Answer

View badges

Content Feed

View by

Answered
how to sort a cell array inside a struct?
I think you would be better off with a table than a struct. Name_Code = table(IDs, C,'VariableNames',["Name" "Codes"]) Name_Co...

ungefär 15 timmar ago | 0

| accepted

Answered
Error with splitting table into separate columns.
This is an application of unstack and then stack. The code looks a lot more complicated than it might if I hard-coded in sizes, ...

ungefär 16 timmar ago | 0

Answered
Coordinate interpolation with time
This line of code pf = polyfit(Lat(:,1) Lat(:,2)], [(Long(:,1) Long(:,2)] %Coordinates is not valid syntax for several reasons...

ungefär 17 timmar ago | 0

Answered
Smartly search between tables
This would be trivial if varfun accepted more than one table input, but it doesn't do that. But you can make one table that look...

ungefär 18 timmar ago | 0

Answered
Calculete monthly anomalies time series temperature
You are not doing yourself any favors by using raw numeric vectors with no timestamps. This is almost trivial using datetime and...

2 dagar ago | 0

Answered
repeating step signal in real time with a hold value of 5 seconds
Like this? >> interp1([1 5 6 10 11 15],[1 1 2 2 3 3],1:15,"prev") ans = 1 1 1 1 1 2 2 2 2 ...

2 dagar ago | 0

Answered
how to expand the date matrix?
roudan, this question doesn't seem to make any sense. For one thing, it doesn't seem useful that you have a column whose header ...

2 dagar ago | 1

Answered
Program architecture for handling large .csv files
With no code at all to go on, it's pretty hard to give specific advice. Hex issues aside, the first advice I would give would b...

2 dagar ago | 1

Answered
Transforming data table from wide to long format
stack to the rescue, twice, because you are stacking two pairs of variables all into one variable: >> tw = readtable("wide_form...

2 dagar ago | 1

| accepted

Answered
Trying to use retime to sum daily values, but I don't want days that only have NaN values to become 0
In the doc for retime (admittedly, not really in flashing bold letters): "All the listed methods omit NaNs, NaTs, and other miss...

3 dagar ago | 0

Answered
Split a target date interval into seasons and find the percentile of days for each season
Another possibility: >> yr = 2020; >> edges = datetime(yr,[1 3 6 9 12,12],[1 1 1 1 1 32]) edges = 1×6 datetime array ...

3 dagar ago | 1

Answered
hours(diff(datetime([t1;t2]))) function
In addition to what others have said, you probably don't need the "hours" in hours(diff(datetime(t1;t2]))) All that does is tu...

3 dagar ago | 0

Answered
Unable to perform assignment because the left and right sides have a different number of elements.
No idea what filename = 'Format_competition.xlsx'; has to do with this, so I suspect you have not told us the whole story. In...

3 dagar ago | 0

Answered
Plot time series analysis from multiple netcdf files
Mir, I'm not very familiar with MATLAB's netCDF features, but there are ways to read the files and you should read the doc about...

3 dagar ago | 0

Answered
Convert Number to Time / Duration Format of Data Column
This is much simpler than you think. You can't currently parse things like "000002" directly into duration, but you can get ther...

3 dagar ago | 0

Answered
Perform a calculation using data from multiple tables
Mark, have you tried using join? t = readtable("flight data.xlsx","TextType","string") t = join(t,T_Distance,"LeftKey","Destin...

3 dagar ago | 0

| accepted

Answered
How to simply the code
"I'm working with cell arrays": Riccardo, you don't want to be doing that, especially not with 100000 rows. Or using a loop for ...

3 dagar ago | 0

Answered
How to stackplot a table?
That seems overly complicated. stack to the rescue? >> t = table(datetime(2021,7,26,0:2:22,0,0)',datetime(2021,7,26,1:2:23,0,...

3 dagar ago | 0

Answered
How to manage NaN values and calculate mean under conditions
Another possibility that uses and preserves a timetable: >> tt = readtimetable("Daily data.xlsx"); >> head(tt) ans = 8×1 t...

3 dagar ago | 0

Answered
Insert two plots and a precreated table in the same figure
Camilo, in general you don't need all those table2array calls. Just do this: plot(Tablecalc.NameOfYour6thVar,Tablecalc.NameOfYo...

3 dagar ago | 1

Answered
Subscripting into a table using three or more subscripts (as in t(i,j,k)) is not supported. Always specify a row subscript and a variable subscript, as in t(rows,vars).
Lihi, hard to say for sure, but you may want to make a table that contains those four tables. For example: >> baseline = table(...

3 dagar ago | 0

Answered
find elapse time with date rollover
Get away from using datenum. Can't say this strongly enough. >> tstr=["11:58:00"; "11:59:00"; "00:00:02"; "00:02:04"]; >> tod ...

3 dagar ago | 1

Answered
How can I create a mat file which changes the values of a column in excel table into the mat file's column headers?
I thnk you'd want to use readtimetable or readtable to bring the first xlsx into matlab. But I'm confused: the second xlsx only ...

4 dagar ago | 0

Answered
Problem using ranova for analysis of variance
Scott, haven't you explicitly not included DietaryGroup with that minus sign? I think you are using it for predictors in a way t...

4 dagar ago | 0

| accepted

Answered
EDF reading: edfread gives timetable; possible to get struct?
Andrew, FEX issues aside, it's possible that the DataRecordOutputType parameter to edfread may help. But it's also possible that...

4 dagar ago | 1

Answered
how to use setvartype on a table that is already existing
setvartype is an import feature. let's come back to that. cell creates a cell array containing nothing but 0x0 doubles: >> c =...

4 dagar ago | 0

Answered
cant put char array in a table of char!
Don't use raw char arrays other than a char row vector. You will eventually be unhappy. Unless you are using a very old version ...

4 dagar ago | 0

Answered
How to filter first fixation times for participants
Like SS, I tried to make sense of this code. And I found the same thing: in a recent version of MATLAB, these few lines would ha...

4 dagar ago | 0

Answered
Conversion and Merger of date and time using datetime
You are correct to use datatime to parse those times of day with : as the decimal separator; duration can't currently do that. A...

4 dagar ago | 1

| accepted

Answered
Normality test of the Matlab function 'randn'
With all due respect (and I mean that), nonsense. MadhiH, I don't know what you mean when you say that, "the p-value is too hig...

ungefär en månad ago | 3

| accepted

Load more