回答済み
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年 前 | 1

| 採用済み

回答済み
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年 前 | 0

回答済み
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年 前 | 0

| 採用済み

回答済み
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年 前 | 0

回答済み
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年 前 | 1

回答済み
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年 前 | 1

| 採用済み

回答済み
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年 前 | 0

回答済み
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年 前 | 1

回答済み
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年 前 | 0

回答済み
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年 前 | 1

回答済み
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年 前 | 0

| 採用済み

回答済み
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年 前 | 0

回答済み
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年 前 | 0

回答済み
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年 前 | 0

回答済み
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年 前 | 1

| 採用済み

回答済み
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年 前 | 0

| 採用済み

回答済み
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年 前 | 0

| 採用済み

回答済み
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年 前 | 0

回答済み
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年 前 | 1

| 採用済み

回答済み
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年 前 | 0

| 採用済み

回答済み
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年 前 | 1

| 採用済み

回答済み
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年 前 | 0

回答済み
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年 前 | 0

回答済み
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年 前 | 2

| 採用済み

回答済み
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年 前 | 0

回答済み
Divide and expand matrix
Something like this you mean: >> x=reshape(1:9,3,3) % starting sample input array x = 1 4 7 2 5 ...

約9年 前 | 0

| 採用済み

回答済み
How to use interp2 to resize arrays of different sizes?
Not sure it will actually be any faster than using |interp1| by column for only two columns and will certainly be far more memor...

約9年 前 | 0

| 採用済み

回答済み
Using min() on vectors with double
_"when I use min(vector), MATLAB returns "Subscript indices must either be real positive integers or logicals."_ This means y...

約9年 前 | 1

さらに読み込む