Answered

Convert julian date SAC to specific format date

I'm gonna suggest another solution that might be simpler to follow. First thing is that this isn't a Julian Date in the strict...

Convert julian date SAC to specific format date

I'm gonna suggest another solution that might be simpler to follow. First thing is that this isn't a Julian Date in the strict...

3 months ago | 0

Answered

How to easily propagate the error of a column ?

Aaron, I think that depends on what you mean by "propagate the uncertainties". There is a simple formula for the variance of the...

How to easily propagate the error of a column ?

Aaron, I think that depends on what you mean by "propagate the uncertainties". There is a simple formula for the variance of the...

3 months ago | 0

| accepted

Answered

Time series data events

Ben, I'm not sure where you are starting from. I'm gonna show how to do this with timetables. Imagine you have a timetable conta...

Time series data events

Ben, I'm not sure where you are starting from. I'm gonna show how to do this with timetables. Imagine you have a timetable conta...

3 months ago | 1

| accepted

Answered

get GPS time to calulate time since referencje epoch

Marta, that depends on what you mean by "GPS time". MATLAB doesn't yet have direct support for GPS time, but if all you want is...

get GPS time to calulate time since referencje epoch

Marta, that depends on what you mean by "GPS time". MATLAB doesn't yet have direct support for GPS time, but if all you want is...

7 months ago | 0

| accepted

Answered

Find the certain amount of values between NaNs and make another variable from these values

There's no need to loop over the 750K elements. Do this on each row x of your data, i.e. loop from 1:50. Try stepping through t...

Find the certain amount of values between NaNs and make another variable from these values

There's no need to loop over the 750K elements. Do this on each row x of your data, i.e. loop from 1:50. Try stepping through t...

7 months ago | 0

Answered

Finding row number of a variable existing in a table

I have no idea what you mean by "In this case the second column and third row of the table.", but this sounds like what you want...

Finding row number of a variable existing in a table

I have no idea what you mean by "In this case the second column and third row of the table.", but this sounds like what you want...

7 months ago | 0

| accepted

Answered

Correlating values from a table using a for loop

Not sure why you think a "loop is better". Try this: >> t = table([1;1;1;1;2;2;2;2;2;2],rand(10,1),rand(10,1),'VariableNames',[...

Correlating values from a table using a for loop

Not sure why you think a "loop is better". Try this: >> t = table([1;1;1;1;2;2;2;2;2;2],rand(10,1),rand(10,1),'VariableNames',[...

7 months ago | 0

Answered

Comparing matrices and filling in the gaps

There are just so many things you can do with joins: >> a = table(["A";"B";"C";"D";"E";"F"]); >> b = table(["B";"D";"F"], [5;1...

Comparing matrices and filling in the gaps

There are just so many things you can do with joins: >> a = table(["A";"B";"C";"D";"E";"F"]); >> b = table(["B";"D";"F"], [5;1...

7 months ago | 0

Answered

Time weighted average after every 60mins

Or put the data in a timetable and use retime(tt,'hourly','mean'). If you need weights, you can write your own aggregation funct...

Time weighted average after every 60mins

Or put the data in a timetable and use retime(tt,'hourly','mean'). If you need weights, you can write your own aggregation funct...

7 months ago | 0

Answered

How can I construct a struct handle from a string?

A scalar struct with a field for each variable that you would have put in the workspace is often useful. It's like a private wor...

How can I construct a struct handle from a string?

A scalar struct with a field for each variable that you would have put in the workspace is often useful. It's like a private wor...

7 months ago | 1

| accepted

Answered

Keeping columns names but replacing value for iteration

You are horzcat'ing tables, and table variable names must be unique. But your two tables both have variables named dist1, dist2,...

Keeping columns names but replacing value for iteration

You are horzcat'ing tables, and table variable names must be unique. But your two tables both have variables named dist1, dist2,...

7 months ago | 1

| accepted

Answered

Preallocation of a vector of structure

Audric, it seems like dpb understand what you are doing better than I do, but "in which each cell will be a structure of 42 fiel...

Preallocation of a vector of structure

Audric, it seems like dpb understand what you are doing better than I do, but "in which each cell will be a structure of 42 fiel...

7 months ago | 0

Answered

convert hourly data to daily sum

Turn your table into a timetable, and use retime: >> hourmelt = table2timetable(hourmelt); >> head(hourmelt) ans = 8×1 tim...

convert hourly data to daily sum

Turn your table into a timetable, and use retime: >> hourmelt = table2timetable(hourmelt); >> head(hourmelt) ans = 8×1 tim...

7 months ago | 0

Answered

missing/incorrect use of math operators?

Jocelyn, modulo Geoff's concerns, I think your whole loop can be done as x = 200*3*(0:5)'; Vx = (sqrt(Vx_o) - ((k3/2).*x))^2; ...

missing/incorrect use of math operators?

Jocelyn, modulo Geoff's concerns, I think your whole loop can be done as x = 200*3*(0:5)'; Vx = (sqrt(Vx_o) - ((k3/2).*x))^2; ...

7 months ago | 0

Answered

Matching the size of two matrices based on values of a column

"contains time in a day in decimal form": That would be your problem. Use timetables with datetimes (or maybe durations?), and u...

Matching the size of two matrices based on values of a column

"contains time in a day in decimal form": That would be your problem. Use timetables with datetimes (or maybe durations?), and u...

7 months ago | 1

| accepted

Answered

How can I fit a mesh plot axis to a vector of time values?

Does this not do what you need? >> d = datetime(2020,11,1:20); >> t = 1:15; >> mesh(d,t,x) Those dates and temps are evenly-...

How can I fit a mesh plot axis to a vector of time values?

Does this not do what you need? >> d = datetime(2020,11,1:20); >> t = 1:15; >> mesh(d,t,x) Those dates and temps are evenly-...

7 months ago | 0

Answered

how do you plot fft of each sensor for both test

Zeshan, you have all your data in a numeric array, t1. I strongly recommend that you convert that to a timetable. Then your plot...

how do you plot fft of each sensor for both test

Zeshan, you have all your data in a numeric array, t1. I strongly recommend that you convert that to a timetable. Then your plot...

7 months ago | 1

Answered

compare datetime with different lengths

SW, if all you want is a plot, there's nothing special you need to do, just plot them. t1 = datetime(2020,11,19) + caldays(0:2:...

compare datetime with different lengths

SW, if all you want is a plot, there's nothing special you need to do, just plot them. t1 = datetime(2020,11,19) + caldays(0:2:...

7 months ago | 0

Answered

Condition for Specific Data collection

Unless you are using a fairly old version of MATLAB, I strognly recommend that you stay away from xlsread, and use readtable or ...

Condition for Specific Data collection

Unless you are using a fairly old version of MATLAB, I strognly recommend that you stay away from xlsread, and use readtable or ...

7 months ago | 0

Answered

importing data and plotting

In a more recent version of MATLAB, I would suggest to not use importdata. It's old and gives you a result that is hard to work ...

importing data and plotting

In a more recent version of MATLAB, I would suggest to not use importdata. It's old and gives you a result that is hard to work ...

7 months ago | 0

Answered

How do I run my MATLAB program through multiple excel files in the folder?

There is. First step: use readmatrix or readtable, stay away from the much older xlsread. Ditto xlswrite. Then use something lik...

How do I run my MATLAB program through multiple excel files in the folder?

There is. First step: use readmatrix or readtable, stay away from the much older xlsread. Ditto xlswrite. Then use something lik...

7 months ago | 0

Answered

How to import an excel file and split a column

The short answer is no. Your timestamps are stored in the spreadsheet as floating point numbers. But why do you need to split ti...

How to import an excel file and split a column

The short answer is no. Your timestamps are stored in the spreadsheet as floating point numbers. But why do you need to split ti...

7 months ago | 0

| accepted

Answered

Consecutive count of values based on multiple conditions

Put your data in a table, and use rowfun with ID as the grouping variable. Write a function that does all the logic you need to ...

Consecutive count of values based on multiple conditions

Put your data in a table, and use rowfun with ID as the grouping variable. Write a function that does all the logic you need to ...

7 months ago | 1

Answered

Arrayfun with a timetable

timetable1 is not a timetable, and probably not even legal MATLAB code. I'm going to assume you mean that you have an actual tim...

Arrayfun with a timetable

timetable1 is not a timetable, and probably not even legal MATLAB code. I'm going to assume you mean that you have an actual tim...

7 months ago | 0

| accepted

Answered

How to use multiple arguments in matrix

Or >> t = datetime(2020,1,1,0:8759,0,0); >> scale = [repmat(.2,1,6) repmat(.5,1,8) repmat(.2,1,2) repmat(.5,1,7) .2]; >> scal...

How to use multiple arguments in matrix

Or >> t = datetime(2020,1,1,0:8759,0,0); >> scale = [repmat(.2,1,6) repmat(.5,1,8) repmat(.2,1,2) repmat(.5,1,7) .2]; >> scal...

7 months ago | 0

Answered

Fill missing NaN by 1 in a table value

Not sure what the question is, but based on your title, "fillmissing".

Fill missing NaN by 1 in a table value

Not sure what the question is, but based on your title, "fillmissing".

7 months ago | 0

Answered

How to read a netcdf file and convert it to time table

Hamed, it's not currently possible to create a timetable that is 3-D (lat-by-lon-by-time). One thing you can do is make a 45*875...

How to read a netcdf file and convert it to time table

Hamed, it's not currently possible to create a timetable that is 3-D (lat-by-lon-by-time). One thing you can do is make a 45*875...

7 months ago | 0

Answered

Plotting Multiple Data Streams with Timestamp

CW, if I am undersatand correctly, you are looking for the same kind of chart that stackedplot makes, for multi-rate data. The o...

Plotting Multiple Data Streams with Timestamp

CW, if I am undersatand correctly, you are looking for the same kind of chart that stackedplot makes, for multi-rate data. The o...

7 months ago | 0

| accepted

Answered

How can i plot multiple plots with respect to date in matlab for forecasting problem ?

No reason why something like this plot(datetime(2020,11,18:30),rand(3,13)) should not work.

How can i plot multiple plots with respect to date in matlab for forecasting problem ?

No reason why something like this plot(datetime(2020,11,18:30),rand(3,13)) should not work.

7 months ago | 0

Answered

if it is greater than 75 percent missing data

I think this would be much simpler if you created a timetable by combining the first 6 vars in the table. Actually, I have no id...

if it is greater than 75 percent missing data

I think this would be much simpler if you created a timetable by combining the first 6 vars in the table. Actually, I have no id...

7 months ago | 0

| accepted