Answered
How to put only the day number on the X-axis while 24 values being plotted for each day?
Did you convert to datetime as I suggested in the earlier thread? If so, if you have late release (R2016b?) use the ruler forma...

9 years ago | 0

Answered
How to find intersection between two outputs?
What you're missing is that |*intersect*| is a comparison of the elements in the two arrays for exact equality of the members th...

9 years ago | 1

| accepted

Answered
How to avoid double counted hours for a given day
Convert your time data columns to _datetime_ values with |*datetime*|. It has ability to use a given time zone and output UTC. ...

9 years ago | 0

Answered
Diff but not when 0
X(X==0)=nan; % flag zero locations d=diff(X); % compute difference w/ flagged d(isnan(d))=0; % replace NaN i...

9 years ago | 1

| accepted

Answered
Retrieving variable declared in batch file, into MATLAB
Already answered in your NG thread <https://www.mathworks.com/matlabcentral/newsreader/view_thread/349153 <view_thread/349153>>

9 years ago | 0

Answered
how to add datetime variable to a bar graph
For some reason TMW hasn't yet gotten around to making the rest of the plotting routines |*datetime*| aware so you've got to rev...

9 years ago | 0

| accepted

Answered
x-ticklabels with varying distance
Yeah, just define an associated _x_ vector on a 1:1 basis with the _y_ values (your _S_ arrays here) that has the appropriately-...

9 years ago | 0

Answered
Using sprintf to match the results of format
As a starting point >> fnprnt=@(x) fprintf('%.5g\n',x) fnprnt = @(x)fprintf('%.5g\n',x) >> fnprnt(pi) 3.1416 >> f...

9 years ago | 1

Answered
Removing an empty folder and subfolder?
The |dir| structure on those subdirectories will return only the two directories entries '.' and '..'. So, check |length(d)|==2...

9 years ago | 1

| accepted

Answered
Read only specific columns and rows of text file with various length
|*dlmread*| isn't able to handle the file with character data in the first column correctly -- that's where the blank line is co...

9 years ago | 0

Answered
Construct a table with the index of the positions of sign changes on a matrix
To find the transition locations use ix=[1 find([false abs(diff(M(:,4)))==2)]; This is then the locations (rows) in the ...

9 years ago | 1

Answered
How to write the following expression in Matlab
Presuming you intended y = 1/[1+sinh(4t) + 3ln^2(t)] as the above would just be y = sinh(4t) + 3ln^2(t) as written w/o an...

9 years ago | 0

Answered
Identify and fill missing time gaps with NaN
"Why?" is floating point roundoff by having built the time series vector by using colon and a |dt| value computed as a fractiona...

9 years ago | 1

Answered
How do I include a header file in MATLAB code?
It's a really basic question but Matlab m-file syntax doesn't include the facility. One way you can simulate it is to make the ...

9 years ago | 0

| accepted

Answered
Log plots - unwanted tick marks
The ticks belong to the opposite-hand axes; their visibility can only be controlled by the outer box property being _'on|off'_ ...

9 years ago | 0

Answered
Error: Undefined function or variable 'fgetl' when fgetl() is placed inside an else statement
fid = fopen(file_in,'r'); line = fgetl(fid); if(fid == -1) error('Error opening %s. Exiting.', file_in); ... ...

9 years ago | 0

Answered
what is error in this code?? {W/ textscan input)
Note the specific text of the error message and the line it error'ed on: "First input must be a valid file-id or *non-empty c...

9 years ago | 0

Answered
How to change date formats of x-Axis?
_"I have a datestring, created with datetime"_ *NO!* You don't have a string at all. |datetime| creates a _datetime_ class...

9 years ago | 1

| accepted

Answered
Plotting two x-Axes with numbers and dates
See <graph-with-multiple-x-axes> for example. They've really made it hard to find the link; I never did find it in current doc; ...

9 years ago | 0

| accepted

Answered
How can i run correlations from one row across several rows in another matrix??
|corrcoef| returns the symmetric array of coefficients, not just the single _r_ statistic for the two-variable case. Hence, in ...

9 years ago | 0

| accepted

Answered
Loop through and plot columns in excel
Fuggetabout the actual columns, just read the data and iterate over however many you have... filename = 'samplefile.xlsx'; ...

9 years ago | 0

Answered
Is there a way to do Column Vlookup or some sort of Left Join in Matlab
[~,lib]=ismember(A,B(:,1)); given A,B of same class. If B(:,2) isn't 1:length(unique(A)) as is here, then res=B(lib,2...

9 years ago | 1

| accepted

Answered
How can I apply a command on all rows of a cell array at once?
The problem is {} on the cell array returns a comma-separated list; each of those values is then an input to |num2str| so that c...

9 years ago | 0

| accepted

Answered
How to efficiently access multiple value in a cell [ ACCESS MULTIPLE ROW FOR A SINGLE COLUMN]
A first step simplification eliminates superfluous parens and (to my eye, anyway) spaces that make harder to read than without--...

9 years ago | 1

| accepted

Answered
Pull same column of cell from same variable, different .mat files
d=dir('results*.mat); % get the list of .mat files qualifying... N=length(d); % how many files are t...

9 years ago | 0

Answered
Plot using combined data from multiple excel columns
_"B1:B5 plus C4:C8 then y data from E4:E8 plus F2:F6"_ The brute-force way... xdata=xlsread('YourXLSFile.xls',1,'B1:C8...

9 years ago | 0

Answered
How to change the color for bar graphs and create space between grouped bars?
ABC=[ [10,13,9,6,20]' [2, 4, 7, 9,10]' [-2,-3,-8,-10,-11]'].'; hBar=bar(ABC,'grouped'); % basic grouped bar plot, keep...

9 years ago | 2

| accepted

Answered
How to preprocess accelerometer data which consists of x,y,z columns from accelerometer, time column in miliseconds and a column which is an annotation for specific activities.
If you have the segments already isolated by the annotation and it's done consistently (that is, if "walking" is always spelled ...

9 years ago | 0

Load more