Respondida
Why the nonlinear least square fitted curve is not a curve?
Why do you think the red line is not a curve ? For this point cloud of experimental data, I think the red line is the best you ...

alrededor de 3 años hace | 1

Respondida
Sorting a matrix according to another one
A = [11 0.001 3 11 0.001 4 12 0.003 5 9 0.002 6 8 0.000 7 10 0.004 8 8 0.000 9 9 0...

alrededor de 3 años hace | 0

| aceptada

Respondida
Lower Dirichlet boundary condition for heat equation PDE
Your equations are not suited to be solved with pdepe. Both contain no second derivatives in space which is necessary for an eq...

alrededor de 3 años hace | 0

| aceptada

Respondida
plot between two variables
Use plot(1:365,[PR;ones(1,365)*PR_ave]); instead of plot(PR,PR_ave); if PR is a row vector, or plot((1:365).',[PR,ones(365...

alrededor de 3 años hace | 0

Respondida
vpa solving 5 equations with 5 unknowns, but result is an empty structure
Did you read somewhere that "vpasolve" can handle inequalities ? Anyway, it seems the problem is too hard for a symbolic soluti...

alrededor de 3 años hace | 0

Respondida
Second time derivative of ODE45 solution looks bumpy
t=[0 5]; initz=[0; 0]; [t,z]=ode15s(@f3, t, initz, odeset('RelTol',1e-12,'AbsTol',1e-12)); for i=1:numel(t) dz = f3(t(i),z...

alrededor de 3 años hace | 0

| aceptada

Respondida
How to plot the first derivative of solution?
Piecewise1111copy() function Piecewise1111copy x1=1; u=3; teta=zeros(3,1); teta(1)=0; for i=1:3 teta(i+1)=2*i; end ...

alrededor de 3 años hace | 0

Respondida
How can I fit the parameters using mle with a self-defined function?
Works for me (see above).

alrededor de 3 años hace | 1

| aceptada

Respondida
Error in my MATLAB code
Explicitly listing the sizes of the matrices involved (see above), I come to the conclusion that yd(t) must be a 4x1 column vect...

alrededor de 3 años hace | 1

Respondida
Solving equations with parameters and then inputting different values
Try a solution with c, k, m, x0 and v0 being symbolic variables. Then you only need to "subs" the numerical values for the para...

alrededor de 3 años hace | 0

| aceptada

Respondida
How i can evaluate characteristic function for a random normal vector
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ChF of X(w) K-dimensional normal(MU,SIGMA) % % X real stochas...

alrededor de 3 años hace | 0

| aceptada

Respondida
Fsolve produces comlex numbers
The usual reasons why solvers like "fsolve" produce complex numbers are: you take the square-root of a negative number (sqrt(x)...

alrededor de 3 años hace | 0

Respondida
When I run my code, I keep getting this error: "Undefined function or variable 'y'."
syms t y(t) syms s real m = 0.05; Dy = diff(y,t); D2y = diff(y,t,2); D3y = diff(y,t,3); eqn = D3y -( -3/m*D2y + 1/m^2*(1-...

alrededor de 3 años hace | 0

Respondida
How can we define the initial conditions u0 at time t+1 as a vector that is equal to the previous initial conditions u0 at time t?
In order to proceed, I need to assign the initial conditions u0 at time t+1 to be equal to the previous initial conditions u0 at...

alrededor de 3 años hace | 0

| aceptada

Respondida
Hi guys, my code doesn't run i couldn't debug this, could you anyone help me?
When you call "calculate_G11_imag", "f "has size 1x2 and "gamma" has size 1x3. Thus f .* gamma is not defined and sum(f .* gamma...

alrededor de 3 años hace | 0

Respondida
Warning: Imaginary parts of complex X and/or Y arguments ignored. > In Finalv3test (line 19) Warning: Imaginary parts of complex X and/or Y arguments ignored. > In Finalv3t
(abs(VGSoff) / VP) is negative, thus (abs(VGSoff) / VP)^sqrt(2) produces complex numbers. Thus ID1 and ID2 are complex-va...

alrededor de 3 años hace | 0

Respondida
Discrete, time varying Dirichlet boundary conditions for heat equation in pdepe
L = 29; x = [0:1:L]; t = [0:1:15]; m = 0; uUpper = trimmedTempData(1,1:16); uLower = trimmedTempData(end,1:16); t0 = trimm...

alrededor de 3 años hace | 0

| aceptada

Respondida
Predicting the value at y(t=8) using my model
thetaL(1)*8 + thetaL(2)

alrededor de 3 años hace | 0

Respondida
how to plot a summation function in matlab using a for loop
For reference: syms k t f(t) = 4*symsum((-1)^(k+1)*cos(k*t)/k^2,k,1,Inf) f(0) fplot(f+2/3*pi^2,[-2*pi,2*pi])

alrededor de 3 años hace | 0

Respondida
How do I get random variables generated from a distribution in [-1, 1]?
The curve for the "noisy h" looks wrong although your formula for the "noisy h" is correct. The noise is h.*0.01*(2*rand(2*N,...

alrededor de 3 años hace | 0

| aceptada

Respondida
Fsolve and initial guesses
You already received several responses for this question here: https://uk.mathworks.com/matlabcentral/answers/1973704-interpret...

alrededor de 3 años hace | 1

Respondida
Find value at which a line changes its slope
Plot gradient(y)./gradient(x) over x to get an approximation of the derivative of your curve and see if this curve can give you ...

alrededor de 3 años hace | 1

Respondida
Why do i keep on receiving the same error? Please show me how to fix the code!
Your function "predprey" must return a row vector, not a column vector: Use function yp = predprey(t, y, a, b, c, d) yp = [a ...

alrededor de 3 años hace | 0

| aceptada

Respondida
Check ode45 for a certain value and start a new solver when these limitations are reached
That's exactly what the Event facility of the ODE integrators does. Look at the "ballode" example: https://uk.mathworks.com/he...

alrededor de 3 años hace | 1

| aceptada

Respondida
Error using fmincon line 619
Why do you solve a linear optimization problem with "fmincon" ? Use "linprog" instead. R = [120.97, 462.26, 231.65, 140.94, 26...

alrededor de 3 años hace | 1

Respondida
MatLab Multiple graphs in one axis
That your measurement curves overlap and those in the literature don't is a fact. You won't be able to hide this by any special...

alrededor de 3 años hace | 0

Respondida
How to do a Taylor expansion with a matrix
Maybe you mean: G = [0,4;4,0]; Gexp = expm(G) or syms t G = [0,4;4,0]*t; Gexp = simplify(taylor(expm(G),t,'ExpansionPoint'...

alrededor de 3 años hace | 1

| aceptada

Respondida
How to use Runge-Kutta orde 4 in sigmoid equation. I want to plot sigmoid equation with Runge kutta orde 4th but my graph is linear. I need help
Why do you use a method for ordinary differential equations to integrate a simple function of the independent variable ? Use "...

alrededor de 3 años hace | 0

Respondida
Interpreting the results of 'fsolve'
Can I trust the variable solutions that is computed for me? An error norm of 0.000177715 is not bad, but "fsolve" couldn't do b...

alrededor de 3 años hace | 0

| aceptada

Respondida
Show more than plot at the same time
help figure https://uk.mathworks.com/help/matlab/ref/figure.html help subplot/tiledlayout https://uk.mathworks.com/help/matla...

alrededor de 3 años hace | 0

Cargar más