Answered
An ode system solution as nlinfit function
‘Does nlinfit solve the system every iteration, in order to obtain the function, or not?’ It solves it at every iteration. I...

6 years ago | 0

Answered
PCA scatter plot shaded circles
Those look like covariance ellipses. See How to draw a covariance error ellipse? and specifically the Matlab source code link...

6 years ago | 0

Answered
Estimate area under a complex curve
The trapz function is likely the best option. The ‘accuracy’ may reflect the way you called it. (Without the data and your cod...

6 years ago | 1

| accepted

Answered
detailed multiplication of state spaces
The multiplication operator (*) is the same as a series call. It appears to connect the outputs of one ‘sys’ object to the inpu...

6 years ago | 0

Answered
How do you record only the pulse in a signal?
Without knowing how similar the signals are, it is difficult to suggest a specific approach. The Signal Processing Toolbox find...

6 years ago | 0

Answered
How to remove and unwanted repeating part of a signal
The Signal Processing Toolbox findsignal function (R2016b and later) could be an option for finding at least the part you want t...

6 years ago | 0

Answered
Butterworth Bandpass filter design
A better design would be: [z,p,k] = butter(n, Wp, 'bandpass'); [sos, g] = zp2sos(z,p,k); or the complete code (that I typed ...

6 years ago | 0

| accepted

Answered
How to print \ in fprintf?
You need to ‘escape’ the backslant (\) with a preceding backslant (\\) in order to print it as you want to. Perhaps this will...

6 years ago | 1

Answered
Can a descriptor state space change into transfer function representaion?
The easiest way to determine that (or anything else that is not explicitly documented) is to try it and see the result. A=[-1...

6 years ago | 0

| accepted

Answered
What is the fastest way to compute the frequency of occurrence in a matrix?
Try this: M = [1 2 3; 4 5 6; 1 2 3; 7 8 9; 7 8 9; 7 8 9; 9 9 9; 9 9 9; 9 9 9]; [M_unique,~,idx] = unique(M,'rows','stable')...

6 years ago | 0

Answered
How to find r square in linear mixed model (fitlme)?
According to the documentation for LinearMixedModelClass, specifically Rsquared, it appears to be available. See if: Rsq = ...

6 years ago | 1

| accepted

Answered
Append rows of string in a table
I can get it to work with character arrays, however not with string objects. I cannot get the char (or similar functions, such ...

6 years ago | 0

| accepted

Answered
Error in a matrix operation
Assuming that everything except ‘c’ is a scalar, it is still necessary to use element-wise operations to calculate ‘d’. Try t...

6 years ago | 1

| accepted

Answered
Legend displays labels with correct colors
See if the approach in When specifying the color of points, legend does not match works in your application.

6 years ago | 0

Answered
Optimizing systems of non-linear equation using optimvar and lsqcurvefit
Your ‘fun’ function will work, providing the dependent variable matrix is (3xN), and ‘y1’. ‘y2’ and ‘y3’ are row vectors. Ass...

6 years ago | 0

| accepted

Answered
How to calculate daily mean from hourly data
One approach: T = 1:5200; % Temperature Vector for k = 1:24:numel(T) k2 = ceil(k/24)...

6 years ago | 0

| accepted

Answered
can any one help me on this how to convert this text file into excel sheet..
Try this: T = readtable('RD-120101-031900.txt', 'PreserveVariableNames',1); FirstFiveRows = T(1:5,:); ...

6 years ago | 0

| accepted

Answered
Plotting potential as a function of x and y coordinates
Try one of these: M = textread('potential.dat'); x = M(:,1); y = M(:,2); z = M(:,3); xv = linspace(min(x), max(x), 25); ...

6 years ago | 1

| accepted

Answered
Plot 2D-histogram for X and Y
Try this: D1 = load('X.mat'); D2 = load('Y.mat'); X = D1.X; Y = D2.Y; data = [X,Y]; hh3 = hist3(data, 'Nbins',[1 1]*60); ...

6 years ago | 1

| accepted

Answered
boucle for with two variables
They are (1x176) and (1x1201) respectively, so the only way to multiply them is to create a matrix: x = [0.45:0.001:0.625]; y...

6 years ago | 0

| accepted

Answered
Standard Error and confidence interval
The actual problem is that the vectors you are working with are row vectors. To create ‘CI95’ as a (2x31) matrix, you need to c...

6 years ago | 0

Answered
How to shift data in a 3D plot?
The easiest way might be to use the circshift function on the appropriate matrix in the appropriate dimension. Then, do the sub...

6 years ago | 0

Answered
Add correlation coefficient (r) and r^2 to plot
I would just use another text object. Alternatively, you can add those to ‘eq’ easily enough. Try this: eq = sprintf('y = ...

6 years ago | 0

Answered
How to save a figure with three - digit numbers or Time Stamps in folder
In order to print a backslant (\) character using sprintf (or its friends), it is necessary to ‘escape’ it by preceding it with ...

6 years ago | 0

| accepted

Answered
finding elements in a vector from another vector
Try this: M = load('m.mat'); X = load('x.mat'); m = M.m; x = X.x; [~,y] = ismembertol(x, m, 1E-4) producing: y = ...

6 years ago | 0

| accepted

Answered
When specifying the color of points, legend does not match
One approach is to add a handle to the plot call (note the semicolon at the end to prevent printing all of the handles to the Co...

6 years ago | 1

| accepted

Answered
Struct contents reference from a non-struct array object.
Use a comma (,), not a period (.): mod(H(i.j),2)==1 ↑ ← HERE x(er,ec)=H(i.j); ↑ ← AND HERE and y(or,...

6 years ago | 0

| accepted

Answered
How should I find the x value of the given y value?
Try something like this: y = 6.585; eqidx = find(diff(sign(curvy_graph - y))); for k = 1:numel(eqidx) ixrng = [-1 0]+eq...

6 years ago | 0

Answered
dsolve - Unable to find implicit solution
That is not very illumiunating. Try this: syms y(t) T Y eqn = diff(y) == y+exp(-y); [VF,Subs] = odeToVectorField(eqn); ...

6 years ago | 0

Answered
ode45 Error using odearguments (line 95)
First, specify: prydot = zeros(6,1); to create the necessary column vector. Then, since it is only neccessary for ‘pry_ODE...

6 years ago | 0

| accepted

Load more