Answered
Curve Fitting using Least Squares
Try this: fcn = @(b,x) b(1).*x./(b(2)+x); x = [20 40 60 80 100 120 140 160]; y = [13 22 30 36 40 43 45 46]; B0 = [50; 50]...

8 years ago | 1

| accepted

Answered
Function Error Input Argument
First ‘f’ does not exist in your function because you do not define it in your code, or pass it as an argument. Second, the s...

8 years ago | 0

| accepted

Answered
How to estimate coefficients for a system of ODE's?
If you are doing parameter estimation of a system of ordinary differential equations, these will likely provide some guidance: ...

8 years ago | 0

| accepted

Answered
LaTex in an annotation
Your ‘str’ variable must come before your annotation call. You are missing curly braces in the ‘\infty’ argument. Change t...

8 years ago | 0

| accepted

Answered
Summation with for loops
I’m not certain what a ‘summation graph’ is. One of these will probably do what you want: x = -10:10; y = zeros(size(x)); ...

8 years ago | 0

| accepted

Answered
Inflection points on grayscale image histogram
Use the gradient (link) function to calculate the numerical derivative, not the diff function. See if the approach in my Answ...

8 years ago | 0

| accepted

Answered
How can I extract the Z data from a figure created using the patch function?
The code you posted does not actually create 'ZData': hp = patch(x',y',z','FaceColor','interp','EdgeColor','interp'); xd = ge...

8 years ago | 0

Answered
'fminunc' function
See the documentation on fminunc (link). It always has been part of the Optimization Toolbox. Depending on the problem you a...

8 years ago | 0

| accepted

Answered
Repeating x-axis for rectangular signal
Try something like this: Angle = reshape(([1; 1; 1]*(0:359))', 1, []); % Create Data; Voltage = reshape(sin...

8 years ago | 0

| accepted

Answered
Plot 2D matrix on 2D graph
Plot it against a 1000-element row vector: figure plot((1:1000), YourMatrix)

8 years ago | 1

| accepted

Answered
unexpected error when trying to open MATLAB
You should click on the Contact Us link in the upper right corner of this page and request Technical Support. If that page re...

8 years ago | 0

Answered
Duplicating rows in a matrix
Try this: M = [0 1 0 0 0 2 0 0]; M2 = repmat(M, 1, 2); M2 = reshape(M2', [], 4)' producing: M2 = 0 1 ...

8 years ago | 0

| accepted

Answered
In an assignment A(:) = B, the number of elements in A and B must be the same.
My version of the Symbolic Math Toolbox doesn’t like quoted strings, so I had to change your code a bit. Try this: syms p x...

8 years ago | 0

| accepted

Answered
kNN Classification on SSVEP response
In my experience, to use knnsearch (link) with data, the idea is to begin with samples that have known classes, then compare the...

8 years ago | 0

| accepted

Answered
Why won't this compute?
I’ve never seen that syntax in any programming language I’ve ever encountered. If I parse it as: strange_expression = (10/1...

8 years ago | 1

| accepted

Answered
Indexing into an Array in a For Loop is Off by 1?
Absolutely guessing here. Perhaps it is because your ‘x’ value begins at 0? Array indices in MATLAB are integers greater tha...

8 years ago | 0

| accepted

Answered
Add a variable within single quotes
I have no idea what your ‘filename’ array is. If it is the name without the ‘.csv’ extension, something like this may work: ...

8 years ago | 0

| accepted

Answered
How can plot multiple same amplitude signals along with same y axis ?
Try something like this using the bsxfun (link) function: x = linspace(0, 2*pi); % Independent Va...

8 years ago | 1

| accepted

Answered
how to automatic segmentation signal
The findchangepts (link) function (introduced in R2016a) is perfect for this: D = load('matlab.mat'); data = D.data; Fs = D....

8 years ago | 2

| accepted

Answered
Definite integration in matlab with the limits changing ?
Try this: f = @(u) (-1.99)./(1.99-2*exp(-0.01*u)-1.98*exp(-2*u)); % u is a dummy variable z = 0 : 5; for k1 = 1:numel(z) ...

8 years ago | 0

| accepted

Answered
High Pass Butterworth Filter increases unwanted frequencies using Filtfilt
First, if you want to eliminate the D-C value, simply subtract the mean of your signal from your signal. You do not need to fil...

8 years ago | 1

| accepted

Answered
Brace indexing is not supported for variables of this type. Error in Untitled3 (line 7) myfile1 = myfile1{1};
The imread function returns a numeric array, not a cell. See the documentation section on A (link) in the Output Arguments sect...

8 years ago | 0

| accepted

Answered
Probability - Linear Regression
I don’t know if you have the Optimization Toolbox or the Statistics and Machine Learning Toolbox, both of which have nonlinear r...

8 years ago | 1

| accepted

Answered
How to plot years on x axis
There are several ways to approach that, including datetime (link) arrays. A simple solution is: M = [ 1975 -66.0577 ...

8 years ago | 0

| accepted

Answered
how to draw a 2d stacked plot
I can barely see any variation, even when I enlarge the image. One option is simply to amplify them, perhaps by 100, and note...

8 years ago | 0

| accepted

Answered
Legend of graph doesn't match plot color and style
You can plot an independent variable aganst a dependentent variable constant, however you will end up with the problem you are ...

8 years ago | 1

| accepted

Answered
How to modify all the datas in a txt files?
Try this: D = load('output.txt') D = D+1; P = 'Your_Path'; save(fullfile(P,'output1.txt'), 'D', '-ascii'); D1 = load('outp...

8 years ago | 0

| accepted

Answered
Error in histogram plot including datetime
You already appear to have the data you want to plot, so histogram may not be the correct choice. Try this instead: figure ...

8 years ago | 1

Answered
Error in using Load
That example should be at: web(fullfile(docroot, 'signal/examples/detecting-outbreaks-and-significant-changes-in-signals.html'...

8 years ago | 0

| accepted

Answered
How can I plot a point which is product of two functions in time domain with changing parameter?
Try this: l = 1; %length u1 = 1; %speed u2 = 0; %turning speed(movement=[u1;u2]=[1;0] %inits : x0 = 0; %rear axle x p...

8 years ago | 1

| accepted

Load more