Answered
How to get a better tolerance for non linear fitting
The fit actually looks quite good. The problem was with the way the plots were coded. Try this: P=[ 175.2582 150.9053 ...

5 years ago | 1

| accepted

Answered
Matlab file disappeared from my computer
If you have Windows, use File Explorer and search ‘This PC’ to see if you can find it. Even though that may take a while, it’s ...

5 years ago | 0

Answered
Differentiation of matrices using diff
Experiment with the gradient function. It may do what you want, although to take the gradient (in this context, numeric spatial...

5 years ago | 0

| accepted

Answered
How to show dot graph in specific range
I am not certain what you want. Adapt this to your data: x = linspace(0, 7200, 250); % Crea...

5 years ago | 0

| accepted

Answered
Electrical circuit from transfer function
This is termed ‘circuit synthesis’ or ‘network synthesis’. See the Wikipedia article on Network synthesis for an introduction. ...

5 years ago | 0

Answered
How to transform matrix V? (A = V*F*inv(V))
Transforming it, creating an implicit function from it, and solving it with fsolve is an option: A = [0 1 0 0 0 ; 0 0 1 0 0 ;...

5 years ago | 0

| accepted

Answered
Extract monthly stock return data out of a table
The data do not go all the way to 2019, instead stopping at 2017 1. Also, if I understand corrctly what you want to do, there...

5 years ago | 1

| accepted

Answered
Solving non linear system
Use the Symbolic Math Toolbox: syms x y S = vpasolve([0 == x^3 + x^2 + x + 4 + 2*y; 0 == x + y - 3]); x = S.x...

5 years ago | 0

| accepted

Answered
Segmenting EMG via a Loop
If the value of ‘int’ is less than 1, the loop counter is satisfied at the outset, and the loop never iterates. The Signal Pr...

5 years ago | 0

| accepted

Answered
Finding sorted rows in a matrix
Two approaches: for k = 1:size(outsx,1) TF(k,:) = issorted(outsx(k,:),2,'ascend') end Result = find(TF) TF = o...

5 years ago | 0

Answered
Changing values in atable
Try something like this: T1 = array2table(randi(9, 10, 3)) Lv = T1.Var2 > 5; T1.Var2(Lv,:) = 1; T1.Var2(~Lv,:) = 0 produci...

5 years ago | 0

Answered
Segment EEG data and Plot sample segmented EEG signal from AF3 channel
If you simply sant to segment it, use the Signal Processing Toolbox buffer function.

5 years ago | 0

Answered
Printing out pi as a symbol in equations instead of the numerical value
When I try to run your posted code, I get: Unrecognized function or variable 'T1'. However, you can get less messy results wi...

5 years ago | 0

Answered
How to create piece wise from matrix?
Start with this approach: f = @(x) (x>622).*4 + ((x>=621) & (x<622)).*3 + ... then continue with the othher elements.

5 years ago | 0

Answered
how to write this xlabel like in this example?
Try adding this to the end of theposted code: text(xt(2:3:end), 188*ones(1,3), {'A-OSA','A-N','C-N'}, 'horiz','center', 'vert'...

5 years ago | 0

Answered
How to find a curve of best fit
Using a completely different approach (System Identification Toolbox): D = readmatrix('RLC1.xls'); t = D(:,1); s = D(:,2); ...

5 years ago | 1

Answered
How to plot the vectors to same scale
See Disable Automatic Scaling in the quiver documentation.

5 years ago | 0

Answered
Vectorization with multiple conditionals
Try this: t1 = -5; t2 = -1; t3 = 5; t4 = 8; fcn = @(t) (t < t1).*0 + ((t >= t1) & (t <= t2)).*(2*t+3) + ((t > t2) & (t <...

5 years ago | 0

| accepted

Answered
Error Using fitnlm Function
Use element-wise operations on every applicable operation in ‘modelfun’ and transpose ‘modelfun’ to return a column vector, and ...

5 years ago | 0

| accepted

Answered
how can i find zero crossing irregularity of the sound data?
Find the zero-crossings using something like this approach: [y,Fs] = audioread('Asthma.wav'); % Impo...

5 years ago | 0

Answered
Parameter estimation for a system of differential equations with multiple time spans
This is definitely a new problem! The usual way of dealing with it would be to vertically concatenate the time vectors and ob...

5 years ago | 1

| accepted

Answered
this is code correct
It appears to be correct, and the code runs without error.

5 years ago | 0

Answered
Optimization with Genetic Algorithms working with vectors
To return a scalar value, take the sum of the squared differences: error= sum((P(:)-Y(:)).^2); % I intend to minimize the mean...

5 years ago | 0

| accepted

Answered
fminsearch curve fitting HELP!!
I am not certain what you are doing. This runs without error, however I have no idea what the correct result should be, or ho...

5 years ago | 0

| accepted

Answered
bvp4c unsolvable
‘Everything is well defined except Xgf,Xsf,Tgf and Tsf’ And, unfortunately, ‘A’,‘Sm’, ‘h’, ‘Cgf’, and a bunch of others. The...

5 years ago | 0

| accepted

Answered
linear least square method to fit the log data
Are you required to use a log fit for those data? If not, try this: objfcn = @(b,x) b(1).*x.*exp(b(2).*x) + b(3).*x.*exp(b(...

5 years ago | 0

Answered
How can I showe laplace answer
Try this: syms s t Y(s) y(t) Dy(t) DE=diff(y(t),t,2)+4*diff(y(t),t)+3*y(t); LL=laplace(DE); LL = subs(LL, {laplace(y(t), t...

5 years ago | 1

| accepted

Answered
How do I solve a system of nonlinear differential equations like the one below?
Add t and Y to the syms declaration, and add these to the end of the posted code: [VF,Subs] = odeToVectorField(odes); odefcn ...

5 years ago | 1

| accepted

Answered
ss2tf always outputs error with line 1, stopped working
You probably want: [num,den] = ss2tf(A,B,C,D,1) rather than: [num,den] = ss2tf(A,B,C,D,l) ↑ ← NO...

5 years ago | 0

Answered
2nd order non linear ODE
‘Do I have to convert it into system of 2 first order equation?’ Yes. The Symbolic Math Toolbox can make that easier. Use...

5 years ago | 0

Load more