Answered
Attempting to find a fit to this data
>> f=fit([x,y],log(z),'poly55') Linear model Poly55: f(x,y) = p00 + p10*x + p01*y + p20*x^2 + p11*x*y + p02*y^...

9 years ago | 2

| accepted

Answered
How to extract numbers from a text file located in the same column, but at consistent row intervals from multiple text files?
In general unless the files are truly huge it's simpler (and probably faster, too) to just read the file and then save what you ...

9 years ago | 0

Answered
Using the curve fit tool. I would like to fit data to TWO straight lines
Can't find it because TMW hasn't implemented it. I just answered a question using a piecewise fit the other day at <https://www...

9 years ago | 0

Answered
Removing leading values in a matrix
Probably easiest is to just process each column in a loop... for i=1:size(x,2) % over each column in x ...

9 years ago | 0

| accepted

Answered
How to fit a Gauss curve in the tails of a curve
If the data typically have such a discontinuity at the tails, a technique we used in the old online "SulfurMeter" which was a ga...

9 years ago | 1

| accepted

Answered
how to get rid of NaN column by column
DM=xlsread('DMdata.xlsx)'; for i=1:size(DM,2) data=isfinite(DM(:,i)); % do whatever with each column here; _data_...

9 years ago | 0

Answered
Deleting rows in matrix due to a certain column's value
V=40000; % use variable rather than embed magic numbers in code ix=A(:,1)>V; % bum row logical vector A(ix,:)=...

9 years ago | 0

Answered
How to obtain this format using either disp or fprintf??? Any basic instruction?
>> data=[1 1.00; 2 2.30; 3 5.79]; >> fprintf('F%d %.2f\n',data.') F1 1.00 F2 2.30 F3 5.79 >>

9 years ago | 0

| accepted

Answered
How to sort by time
>> dnm=datetime(c(:,1),'format','yyyy/M/d HH:mm'); % convert date strings >> target=datetime('2015/7/23 17:0...

9 years ago | 0

Answered
problem assigning integer values in image to NaN
NaN is a concept for floating point arrays only; if the image is one of the integer classes the assignment will be as you noted....

9 years ago | 2

Question


datetime error/inconsistency
>> datetime(1963,0,213) ans = 01-Jul-1963 >> datestr(datenum(1963,0,213)) ans = 01-Aug-1963 >> sum(eomda...

9 years ago | 2 answers | 0

2

answers

Answered
Probabilistic analysis - failure frequencyseems unreasonable
The product of two Gaussian random variables is a linear combination of two Chi-square random variables: XY=[(X+Y)/2]^2 − [...

9 years ago | 0

| accepted

Answered
can someone explaing the computation for double sided and single sided spectrum in fft() example
The example is single-sided from F=0:Nyquist (Fs/2). Since the FFT returned by Matlab is double-sided, from -Fmax:+Fmax, ...

9 years ago | 7

Answered
Why does textscan read only 95% of my data file?
There'll be a formatting discrepancy in the file at the offending line that causes |*textscan*| to fail. |*fgetl*| otoh reads t...

9 years ago | 0

Answered
function help - selects the even rows and columns and returns of matrix M and then puts them in a new matrix called even
You didn't pass any argument to the function when you called it -- hence there was nothing inside the function for _M_ M=ra...

9 years ago | 1

| accepted

Answered
Global variables in functions
>> help clear ... | clear GLOBAL removes all global variables. ... However, using |global| is _not_ recomme...

9 years ago | 0

Answered
how interpret Kolmogrov test outputs?
|h,p| are the results of the hypothesis test at the (default) 5% significance level-- |h| is a logical "pass/fail" flag while |p...

9 years ago | 1

Answered
Why do I get undefined variable error in the attached code?
As another wrote, looks like you transposed the LH and RH sides of the assignment of input argument _x_ to local variables. Why...

9 years ago | 0

Answered
is it possible to convert a vector from a dataset to a categorical array in matlab 2012 b?
In R2012b |categorical| is an abstract class in the Statistics Toolbox; you cannot create instantations of it. |nominal| and |o...

9 years ago | 0

Answered
Add a marker to surf plot
You've got the surface occluding the z-axis values -- to make the point show try something like ZMax=max(Z(:)); plot3(x,...

9 years ago | 1

| accepted

Answered
Plot shifting between two values in if statement
... for k=1:N-2*K, ... if(e_k>e_k1) estimated_c=estimated_c+(c)*e_k*y_k/n; plot(k,estimated_c,'...

9 years ago | 0

| accepted

Answered
Getting a new matrix after comparing two matrices in some conditions
_"... can check whether the rows of L1 are included in K1. I can't count the times and formulate new matrix R"_ Well, if you ...

9 years ago | 0

| accepted

Answered
readtable with fixed column width from a txt file
The warning is simply |*readtable*| complaining about the space in the first column heading; it's not smart enough to just smush...

9 years ago | 0

| accepted

Answered
Interpolating from different rows in a for loop
Well, the syntax to address the row after the current is, as you've written, X(indx+1,:) but in your code n = length(X(:,1...

9 years ago | 0

| accepted

Answered
How to plot from table
Going to a lot of trouble that doesn't seem needed in writing stuff out to files instead of just using the in-memory data direct...

9 years ago | 0

| accepted

Answered
How to save the data when we are using dir('*.hdf')
While not your specific problem (at least yet), using the magic number of 365 for the loop isn't good practice; use for i=1...

9 years ago | 2

| accepted

Answered
What are the row and column subscripts needed to access the 167th element of the fourth cell
All depends on what the array dimensions are; you don't need them anyway if you wish the Nth element, just use one-dimensional s...

9 years ago | 0

Answered
How can I read a text file as fixed width columns?
cw=[1 2 6 1 1 2 2 2 2 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5]; fmt=sprintf('%%%dd',cw); % file open preamble code here for open...

9 years ago | 0

| accepted

Answered
Retrieve data from textfile
fmt=['{"metadata":{"date":"' '{%{M/d/yyyy hh:mm:ss a}D' '","TotalShrooms":{"AbsoluteTime": %f %*[^\n]']; % file open prea...

9 years ago | 0

Answered
Plot 3 lines using plotyy
[hAx hL1 hL2]=plotyy(x,[y(:) y2(:)],x,y1); *NB:* The colon on the _y_ is to ensure are column vectors for the concatenatio...

9 years ago | 1

| accepted

Load more