Answered
How do I perform a linear least squares fit
You don’t need any toolboxes. Use polyfit (link) and polyval functions, or the mldivide (link) operator.

8 years ago | 3

| accepted

Answered
Plot multiple categorical Pie Chart. Keep the color for each value.
One approach: Data = randi(9, 4); % Create Data Labels = {'Aaa','Bb','CQ','Dd'}; ...

8 years ago | 0

Answered
Find max values for each year
Your ‘rain’ array does not exactly match the header information you posted for it, since there are only 6 columns. This fills...

8 years ago | 2

| accepted

Answered
how to link ODE45 solver with optimisation toolbox for least squares minimisation toolbox ?
Several examples: Monod Kinetics and Curve Fitting (link) Solving Coupled Differential Equations (link) Parameter Estimatio...

8 years ago | 0

Answered
How can i find this value x at the below expression
Using the fzero function: invx = @(x) tan(x*pi/180.0)-(x*pi/180.0); x = fzero(@(x) invx(x) - 0.0149, 1) producing: x =...

8 years ago | 1

| accepted

Answered
how do i plot magnitude and phase of transfer fucntion defined by (ρ0*sinh(⁡(s^2/c^2)*(L-x)))/((s^2/c^2)*sinh⁡((s^2/c^2)*L))
Try this: s = tf('s'); c = 42; L = 3; x = 5; rho0 = 7; w = linspace(0.5, 1E+2, 50); beta = tf(s^2/c^2); n = beta*(L-x);...

8 years ago | 1

Answered
Solving system of first order linear differential equations
You can use the numeric solvers if that works for you. It may be easier to use the expm (link) function for a linear problem su...

8 years ago | 0

Answered
How do I scale coordinates for different size
I am not certain what you want. Try this: Scale = [920 1; 850 1] \ [960; 882] NewValue = [920 1; 850 1] * Scale producing...

8 years ago | 0

| accepted

Answered
How can I prevent Y axis exponential from overlapping with the plot?
I could reproduce that behaviour in R2018b. This is obviously a bug. Try this: x = logspace(-4, 2, 25); ...

8 years ago | 1

| accepted

Answered
lsqcurvefit stopped because the size of the current step is less than the selected value of the step size tolerance
Your initial ‘B0’ is about as close as you can get to the best fit. I experimented with perturbing ‘B0’ by small amounts, and n...

8 years ago | 0

Answered
How can I extrapolate data using regression learner app?
You have not posted what you are doing or the model you are using, so I suggest that you click on Export Model, then post the ex...

8 years ago | 1

Answered
Problem with plotting X @(theta)
Since you did not share your code, I can only guess what the problem is. First, if you refer to a function within another fun...

8 years ago | 1

Answered
How ı plot the piecewise function
Try this: A = 2; f = @(t, t1, t2) A.*((t1 < t) & (t < t2)); % Use ‘Logical Indexing’ t = linspace(0, 10);...

8 years ago | 1

Answered
How to download ECGsignal with baseline wander noise from MIT-BIH database
If you want to know how to use the database, for example, see: How can i fix this error? If you want a specific record with a w...

8 years ago | 0

Answered
how do i close plotted graph?
Try this: figure plot(randn(1, 10)) hf = gcf; pause(5) close(hf)

8 years ago | 1

| accepted

Answered
deaseasonalize temperature data using means
Without your data, it is difficult to write specific code. From your description, this may work: Yrv = [ones(12,1)*2017; on...

8 years ago | 0

Answered
Extend a line made with polyfit and polyval
You are doing linear regressions, so extending the line is not a problem. (It easily could be a problem with higher-order polyn...

8 years ago | 0

| accepted

Answered
Is there a function to find the product of a transfer function array?
See if the series (linik) function will do what you want.

8 years ago | 0

Answered
How to transform a 2x5184 data set
Try this: D = [2.0000 28.2000 2.0000 28.2000 2.0000 25.8000 2.0000 24.7000 2.0000 23.5000 2...

8 years ago | 0

| accepted

Answered
I want to use inverse laplace with tf function. How can I do it? I take an error in matlab when ı use code like below.
Try this: A=[-2 0 ; 0 -1] B=[1;2] C=[1 1] D=0; P=ss(A,B,C,D) syms s t F=tf(P) num = poly2sym(F.Numerator, s) den ...

8 years ago | 0

| accepted

Answered
Please Check the code commented with a star. there i want to find the time when h is 0. I am new to MATLAB and can not find the error.
There are several ways to do this, the most reliable being event functions. Since you want to find one value one time, try this...

8 years ago | 0

| accepted

Answered
What is the most efficient way to create a logical index from values in a matrix?
I use three lines here for the complete illustration. If you have already assigned the first two lines, the third is all that i...

8 years ago | 0

| accepted

Answered
plot solution of linear systems (linsolve)
This was something of a challenge in the format presented. % % % Equations: -2*x + y = 1; 3*x + 2*y = 10; -15*x + 2*y = -80...

8 years ago | 0

Answered
Design filter to remove two different frequencies
If you have R2018a or later, use the bandstop (link) function. Cascade two filters, one for each frequency. If you use the sec...

8 years ago | 0

| accepted

Answered
How to make plot from if statement?
This version uses ‘logical indexing’ in the function: x = linspace(-5,5,50); Yfcn = @(x) (x*1.5+3).*(x>-2 & x<0) + (x*(-1.5...

8 years ago | 1

| accepted

Answered
how to use fft to find my motor acceleration's frequency
Your signal is contaminated with broadband noise, so a frequency-selective filter will not remove it. I believe this is what ...

8 years ago | 0

| accepted

Answered
Fourier transform how to get coefficients
With the MATLAB fft function, at each frequency, the real value is the cosine coefficient, and the imaginary value is the sine c...

8 years ago | 0

| accepted

Answered
I need a matlab code for this Question in order to get the output if number of spike in a given range greater than some threshold gives 1 otherwise gives o.please find the attached file
See this (Accepted) Answer for an approach: How can ı do spike sorting to filtered EEG signal (Answer)

8 years ago | 0

Answered
How do I get rid of lines connecting error bars?
Specify a marker only in your errorbar call: errorbar(valuesfrex,errex,'.');

8 years ago | 2

| accepted

Answered
How to acieve a scatter plot like this.
Use the surf (link) function and the view (link) function: M = nan(50); M(10:40, 5:30) = rand(31,26); figure surf(M) vi...

8 years ago | 1

| accepted

Load more