Answered
Median(here it's middle ) of vector/array of every two adjacent values in array (value(i+1)-value(i)).
Not so sure why this would be puzzling... tm=diff(t)/2; You have one few differences than elements of t, of course.

6 years ago | 0

Answered
How to transform time series into frequency dimain and obtain amplitude and phase
There's really nothing wrong with the code; you have followed the example from the documentation for FFT and the following lines...

6 years ago | 0

| accepted

Answered
Count words from wordlist in a text
Start @ <Analyze-text-data-with-string-arrays> You may also find ismember of interest for the last...

6 years ago | 0

| accepted

Answered
Breaking data from a large text file into groups
Well, the following is pretty easy as far as counting goes...how it works on real file as far as speed and whether need to read ...

6 years ago | 1

| accepted

Answered
Error Explanation Error: File: C.m Line: 169 Column: 5 This statement is not inside any function. (It follows the END that terminates the definition of the function "readeph".)
I edited the function for you ...starting with fixing the indention to be consistent by block...which shows when you get back to...

6 years ago | 1

| accepted

Answered
How to define the data type of each column in a struct?
MATLAB is amorphous on type -- everything is stored as the type of the RHS on assignment unless directly addressing the element ...

6 years ago | 0

| accepted

Answered
Put the name in the "x axis" of the graph bar every five days or seven days
Well, if you say so... :) tEnersol=readtable('enerosolar.xlsx','Sheet','EneDic'); % read into a table object tEnersol.Propert...

6 years ago | 1

Answered
Put the name in the "x axis" of the graph bar every five days or seven days
Don't put the ticks every day; that's the cause for there being that many--you did it to yourself! :) The bar() command will p...

6 years ago | 1

| accepted

Answered
Is there maximum number of characters of the figure title latex interpreter string?
First, you must pass a char() string, not cellstr. You've got too many $ signs for pieces, but a start at what outlined above us...

6 years ago | 0

Answered
Access data within timerange
The timerange object is another of those opaque thingies TMW has fallen in love with that has useful stuff inside it that is hid...

6 years ago | 3

| accepted

Answered
Replacing a column values of a table?
Replace [[time2]=modeldata.Time; time = datetime(time2,'InputFormat','MM/dd/yyyy HH:mm:ss:SSS',... 'Format','dd/MM/yyyy HH:mm...

6 years ago | 0

Answered
randn() function command help
nddata = fix(8*randn(10,5,3)) "... I am not sure what 8 is doing here, it is not multiplying the outcome of the random number...

6 years ago | 1

Answered
Error "Index in position 1 exceeds array bounds (must not exceed 1)" for a matrix that has a size of 2000x11
A=(-G(i,j)*(epsilonzz(i-1,j)-epsilonxx(i-1,j)))+tempvalue; You just redefined the whole array A to the RHS consisting of a sing...

6 years ago | 0

| accepted

Answered
Error bars drawn asymmetrically in errorbar()
Yeah, the y-axis scale is logarithmic so the positive and negative differences are scaled differently depending where on the lo...

6 years ago | 0

| accepted

Answered
iteration with for for a simple computation
One way amongst many... z=acos(m); % precompute the constant array T=c(1)+sum(cell2mat(arrayfun(@(c,i) c*cos(i*z),c(2:end...

6 years ago | 0

| accepted

Answered
How to remove common row elements from matrix
[~,ia]=unique(A(:,10:12),'rows'); O=A(ia,:);

6 years ago | 0

| accepted

Answered
Linear fit line for multiple Y-axis
You'll get same coefficients if you fit b=polyfit(t,mean(y,2)); % assume columns are variables, rows, observations as will b...

6 years ago | 1

| accepted

Answered
How do I use a for loop to index a categorical vector?
If the two indeed correlate, the result should be as expected -- ergo, can only presume they don't correlate as you think...exam...

6 years ago | 0

| accepted

Answered
draw a line with known slope and one set of coordinates
m=tan(theta); % tan()=y/x --> slope b=y1-m*x1; % intercept to pass thru x1,y1 at given s...

6 years ago | 0

| accepted

Answered
Split and search strings
There's new set of higher-level functions that will do the first... >> str2double(extractAfter(split(DetailInfo,";"),"=")) ans...

6 years ago | 1

Answered
Data store only importing 2 columns
DateTimeUTC,AIMHeading,AccX,AccY,AccZ,Surge,Sway,Heave,Roll,Pitch,Inclination,Yaw,HeaveAtRadar,RadarValue,CompensatedRadarValue,...

6 years ago | 0

| accepted

Answered
Adding additional data to previous table
If it's not time-critical, it's trivial to just dynamically append -- presuming the table exists initially and the content of th...

6 years ago | 0

| accepted

Answered
Splitting time series into segments
Use findgroups to segregate the state groups and plot() over those group indices. Converting the array to a table makes things ...

6 years ago | 0

Answered
How to generate quarterly date in Matlab?
datetick('x', 'mm/dd/yyyy'); is your problem. datetick is/was ONLY used for the deprecated datenum which was just a double in ...

6 years ago | 0

Answered
for loop in indices count
>> arrayfun(@(i1,i2) colon(i1,i2),iVmx,iVmn,'UniformOutput',0) ans = 1×6 cell array {1×455 double} {1×203 double} ...

6 years ago | 0

| accepted

Answered
unstack warnings about variable names
Just what is says... :) Your table (or timetable) contained data values that were not valid to be used as MATLAB variable names...

6 years ago | 0

| accepted

Answered
Output is -INF
You had ... x1 = xi + dt*(a*xi*(1 - xi/20) - b*xi*yi - c*xi*zi); y1 = yi + dt*(yi*(1-yi/25) - a*xi*yi - d*yi*zi);...

6 years ago | 0

Answered
How do I draw a number of arbitrary grid lines from data in arrays, independently from the default grid?
The trick used there (Nichols plot and other response plots) is to tag them all when drawing and then them all to be hard for us...

6 years ago | 0

| accepted

Answered
how to set a frequency of x axis of a plot?
Read up on datetime and plot and the DatetimeRuler... t=datetime(2018:2033,1,1); y=randn(size(t)); % dummy data over your ti...

6 years ago | 0

Answered
how to set a frequency of x axis of a plot?
If your variable is (as was suggested in other thread asking about formatting it) a datetime, just use xticks with the time span...

6 years ago | 0

| accepted

Load more