Community Profile

photo

Peter Perkins

MathWorks

Last seen: Today 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

배지보기

Content Feed

보기 기준

답변 있음
How to treat a duration array in a for loop?
Judith, I can't really follow what you are doing, but if you have timestamped data, you should be using a timetable, and then re...

약 22시간 전 | 0

답변 있음
Reorganize table and make groups of rows to columns
You need unstack: >> Date = datetime(1963,[1;2;3;1;2;3;1;2;3],[31;28;29;31;28;29;31;28;29]); >> Permno = [10065;10065;10065;10...

약 22시간 전 | 2

| 수락됨

답변 있음
Delete rows in cell aray where there is anything in one collum.
A cell array is the wrong way to store these data. You want a table, or probably a timetable. The fact that you say, "the name o...

약 22시간 전 | 0

| 수락됨

답변 있음
Prevent overwriting within a for loop in 3D-motion tracking
You may just want T = table(); for ... ... T = [T; readtable (thisFile)];

약 22시간 전 | 0

답변 있음
How to convert the number of seconds from an epoch into UTC using the datetime function.
Matthew, this is easier than you think. In MATLAB, 'TimeZone','UTC' is sort of a ficticious timeline that pretends that leaps se...

1일 전 | 0

| 수락됨

답변 있음
How to plot only the matches of two different datetime?
If all you have are two datetime vectors, you can use intersect to find the common values. But I'm guessing you have other data ...

2일 전 | 0

답변 있음
How to filter the data.
Not sure how you are getting those data into MATLAB, but I suggest that you figure out why you have a cell array. You want a tab...

2일 전 | 0

답변 있음
extracting columns from multiple cell arrays consist of table data
If you've read two "similar" tables into a 2x1 cell array, best ting to do is to vertvat them outside the loop: >> C = {array2t...

5일 전 | 1

| 수락됨

답변 있음
split cell in 2 columns
Use cellfun, two possibilities: function [val1,val2] = myfun1(x) val1 = x(1); if isscalar(x) val2 = 0; else val2 =...

5일 전 | 0

답변 있음
How do I find the corresponding date/time value of the maximum of my data in a table?
This is a pretty common question, so I'm gonna show a bunch of stuff in hopes others can find it useful. Let's start with a sim...

5일 전 | 0

| 수락됨

답변 있음
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...

6일 전 | 0

| 수락됨

답변 있음
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, ...

6일 전 | 0

| 수락됨

답변 있음
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...

6일 전 | 0

답변 있음
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...

6일 전 | 0

답변 있음
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...

7일 전 | 0

답변 있음
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 ...

7일 전 | 0

답변 있음
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 ...

7일 전 | 1

답변 있음
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...

7일 전 | 1

답변 있음
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...

7일 전 | 1

| 수락됨

답변 있음
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...

8일 전 | 0

답변 있음
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 ...

8일 전 | 1

답변 있음
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...

8일 전 | 0

답변 있음
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...

8일 전 | 0

답변 있음
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...

8일 전 | 0

답변 있음
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...

8일 전 | 0

답변 있음
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...

8일 전 | 0

| 수락됨

답변 있음
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 ...

8일 전 | 0

답변 있음
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,...

8일 전 | 0

답변 있음
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...

8일 전 | 0

답변 있음
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...

8일 전 | 1

더로드