Answered
Full factorial design in MATLAB
"Because" is probably the best answer...the two levels are simply coded levels. >> ff2n(2) ans = 0 0 ...

8 years ago | 0

| accepted

Answered
how to simplify/consolidate repeat functions
Don't use sequentially number variables; use arrays or alternate storage techniques instead. See the FAQ for why not and mor...

8 years ago | 0

Answered
How to give single/global title over several subplots?
Nearly a FAQ...see <https://www.mathworks.com/matlabcentral/answers/100459-how-can-i-insert-a-title-over-a-group-of-subplots?s_t...

8 years ago | 0

| accepted

Answered
How to append data to current row in an excel sheet???
doc xlsread doc xlswrite You can read/write from/to any area in the file; probably the simplest to code is to read the r...

8 years ago | 0

| accepted

Answered
File data with columns arranged with different number of rows.
Three (basic) alternatives-- # concatenate the shorter vectors to the length of the longest with NaN or other missing value t...

8 years ago | 1

Answered
How to find a minimum value of a function in term of a variable?
Well, there's just one variable by name but that variable can be an array... >> fns = @(x) 5*x(1).^2 + 13*x(1) + 7*x(2).^2 ...

8 years ago | 0

Answered
How Do I Remove Scientific Notation From X/Y Axes on Plotted Data
Yes, when you set the tick label that then becomes hardwired text independent of the value. Are the x axis variable(s) in |da...

8 years ago | 0

Answered
How can I change an array into the scalar of its components?
Let the i/o rtl help... >> str2num(sprintf('%d',[1:4])) ans = 1234 >>

8 years ago | 0

| accepted

Answered
Find unique rows in a cell array with mixed data types
>> t=cell2table(stations) t = 2×3 table stations1 stations2 stations3 _________ _________ _________ ...

8 years ago | 1

| accepted

Answered
plotyy: how to use 'datetick' on both axis
_"It seems that 'datetick' does not allow using axis-objects, ..."_ Not so-- >> help datetick .... datetick(AX,...

8 years ago | 0

Answered
How to find Missing data and insert Nan
_"25101.0 and the second 30 mins is 25102.0."_ Then missing points will be where ix = [diff(t) ~= 1 | diff(t) ~= -23] + ...

8 years ago | 0

Answered
How to compare exponential numbers with 7-9 digits of accuracy
doc ismembertol

8 years ago | 0

| accepted

Answered
How to save each data from for loop
Easiest solution is to save each in cell array since the subsets can all be differing sizes can't just store as planes in 3D arr...

8 years ago | 0

| accepted

Answered
show baseline value on y-axis
If there isn't a tick at the baseline value, two choices-- following assumes have saved the necessary handles; hAx for axes obj...

8 years ago | 0

Answered
Don't seem to find the error
With venerable |datenum| >> datenum(2018,2,10)-datenum(2018,1,1)+1 ans = 41 >> or with new(ish) |datetime| ...

8 years ago | 1

| accepted

Answered
Adding a scatter of points to a boxplot
Indeed, that seems to work just fine... load carsmall MPG % the sample dataset variable hold on scatter(...

8 years ago | 1

| accepted

Answered
How do I get matlab to read a string of dates and times
|readtable| will import Excel dates as |datetime| values which you can then convert from Excel encoding to Matlab with the _'dat...

8 years ago | 0

Answered
Calculate the mean in a single operation with matrices
mngeo=geomean(M.*W); where |M, W| are the matrix and associated weights matrix

8 years ago | 0

Answered
Difference between character variables where one shows the whole word versus the value of an array?
'Pends on how you're storing and addressing it...a char() array is just that an _array_ of characters and so, just like a numeri...

8 years ago | 0

| accepted

Answered
Removing matrix rows in while-loop
_"The columns are date, flow, and pH. I am trying to remove any row where the pH meter erroneously read 0"_ data(data(:,3)=...

8 years ago | 1

Answered
Fit-Curve through certain start point
The easiest way is to use one of John D'Errico's inestimably-valuable tools from the FEX; in this case <https://www.mathworks.co...

8 years ago | 1

| accepted

Answered
How to see if the same point is plotted on two different graphs
Rik's point is a good one to use the actual data for the two plots providing it hasn't already been trashed. It's no major deal...

8 years ago | 0

| accepted

Answered
Datenum Generating different numbers for same time difference
FP roundoff; |datenum| just uses a double for the time serial value; the integer portion is days and the fractional part the fra...

8 years ago | 0

| accepted

Answered
How to plot only negative values in a WindRose?
Contact the author of the submission; perhaps will have some help/advice since was the author. As for the last error, Er...

8 years ago | 1

| accepted

Answered
Split vector by parts with more evenly distributed length
Consider the following... >> for k=fix(sqrt(L)):-1:2,if rem(L,k)==0,disp([L,k,L/k]),end,end 2184 42 ...

8 years ago | 0

Answered
Sort raw data from a stream, with more zeros on top
>> [~,ix]=sortrows([sum(Z==0,2) dE],[-1 2]) ix = 1 3 4 5 2 >>

8 years ago | 0

Answered
Sorting and Equating n-number of least Values in the row to NaN
[~, idx] = sort(A(10,:),'ascend'); % keep the index; don't care about the values really A(10,idx(1:5))=nan; ...

8 years ago | 1

| accepted

Answered
How do I make an array of elapsed times?
str = 'April 18, 1995 12:00:00'; t1 = datetime(str,'inputformat','MMM dd, yyyy HH:mm:ss'); stoptime=datetime(stopdate,'i...

8 years ago | 1

Answered
Split variable length vector by parts
L-length(V); P=17; id2=[repmat(P,1,fix(L/P)) rem(L,P)]; % number elements in cell size P matching L plus remainder ...

8 years ago | 0

| accepted

Answered
Is there a better way to write this short function, without the 'for' loop?
mtch=ismembertol(Tbl(:,VarNames),VarVals,Tol); but will be array, not vector and if return only the vector result of |find|...

8 years ago | 0

| accepted

Load more