Answered
Replace a variable in a fuction handle by a function
Define "modelfun" for "nlinfit" not as a function handle, but as a normal function. Within this function, you can do everything ...

2 years ago | 0

Answered
Using fittype with a symbolic function
The problem was solved by converting the symbolic function "qme" to a numerical function handle by using qme_numeric = matlabFu...

2 years ago | 0

| accepted

Answered
fmincon: optimize till nonlinear condition is false
Is there an option for fmincon or other optimizers to define this or maybe to ask the optimizer to go on till the nonlinear cond...

2 years ago | 1

Answered
i tried to find k which depends on w , but i cannot preallocate p3,p4.....,please help?
Use A=[e15*exp(k),-e15*exp(-k),(c44*p3(j)+e15)*s3(j)*exp(s3(j)*k),(c44*p4(j)+e15)*s4(j)*exp(s4(j)*k),(c44*p5(j)+e15)*s5(j)*exp...

2 years ago | 0

Answered
Error in bvp4c code
@(r,y)baseBC(ya,yRc,yRp,yRb,P0,We,m,Da,beta,alpha,phi) You don't want to use ya and yb (in your notation: r and y), namely the ...

2 years ago | 0

| accepted

Answered
How to plot a current based on active voltage?
i = [100,10,100]; t = [0,0.2,0.4,0.6]; R = 8.314; F = 9.648e4; Temp = 80 + 273.15; %Conductivity reference temperature ipp_...

2 years ago | 0

| accepted

Answered
graphs are not displaying
"initial_state" had to be defined. globals had to be included where the variables were needed. "y" has been removed from the g...

2 years ago | 1

Answered
Differential equation to find activation voltage
Matlab cannot find an analytical expression for u. You have to use a numerical approach. I'm not sure about the term exp(b_an*G...

2 years ago | 1

| accepted

Answered
How do I need to configure Matlab's solver such that it returns the correct solutions when complex magnitudes are involved?
Better use solve(expression*expression'==1,w) instead of solve(abs(expression)==1,w) From your hand calculation it follows t...

2 years ago | 0

| accepted

Answered
linsolve for coefficient matrix
A.'*X.' = B.'

2 years ago | 1

Answered
system of non linear equations
%solving stsyem of nonlinear equation 3.31 and 3.32 Woods paper with fsolve % eta_l= x1 , eta_u= x2 r=2; v=20; F=13/9; fu...

2 years ago | 0

| accepted

Answered
not enough input arguments help in line 6 please explain why.
Works (see above). The list of input arguments to your function in the call to ode45 was wrong. [v,x] = ode45(@(v,x)ch6(t,x),v...

2 years ago | 1

| accepted

Answered
The return value of the objective callback function must be a real double scalar.
Looking at your objective function, it seems it it returns complex values. This will make MATLAB error - you cannot minimize a f...

2 years ago | 0

Answered
Solving a system of 6 DAEs of first order - index error
The reason why it doesn't work is that you don't have an equation that directly solves for y. Equation (1) solves for w, equati...

2 years ago | 0

| accepted

Answered
Please help me with this qustion
syms v1 vo = 4/10 + v1 eqn1 = v1/10 + (v1-60/20) + v1-5*vo/20 ==0 v1_sol=solve(eqn1, v1) vo_sol = subs(vo,v1,v1_sol)

2 years ago | 0

Answered
odextend initial guess error
Compute the solution up to t1 using ode15s. Make a loop over the different F(t)'s you want to prescribe and restart all the con...

2 years ago | 1

Answered
How can I correct this error "Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters"?
Maybe [t,y] = ode45(@equfunc,[0 200],1); plot(t,y) Look at the examples provided in the documentation of ode45: https://uk....

2 years ago | 0

Answered
Can't solve the equations
You must tell us which solution you want. syms pb pg sb = 1; ds=0.25; dm=0.2; k=1; sg=1; m=0.01; r=0.06; f=0.075; ms=0...

2 years ago | 0

Answered
For some reason, I am not getting plots when I put in this code for this question.
if Delta > 0 % Case of real and distinct roots x1 = (-b + sqrt(Delta)) / (2*a); x2 = (-b - sqrt(Delta)) / (2*a)...

2 years ago | 0

Answered
I get an error despite that the variable xddot is in the scope of the Nested function
To compute Fxfr in the line f1 = a*(Fyfr + Fyfl) - b*(Fyrr + Fyrl) + Bf/2*(Fxfl - Fxfr) + Br/2*(Fxrl - Fxrr); you need x...

2 years ago | 0

Answered
correct the following code for unsteady maxwell nanofluids
dydx has to consist of 6 equations: dydx(1) = y(2), dydx(2) = y(3), dydx(3) = f''' dydx(4) = y(5), dydx(5) = g'' dydx(6) = h'...

2 years ago | 0

| accepted

Answered
Numerical differentiation in time in function used by ODE
ode15s can solve systems of differential equations of the form M*y' = f(t,y) where M is the so called mass matrix. If a row j of...

2 years ago | 0

Answered
Finding Solution to Inequality in Matlab
I don't understand the result, but there is some output from the symbolic toolbox. As you can see, the numerator of sol.x is a ...

2 years ago | 1

Answered
Nonlinear equation solver for neoclassical growth model
Set the right-hand sides of the resource constraint and the production constraint equal and solve for i(t). You will get an equa...

2 years ago | 0

Answered
Error: Incorrect dimensions for matrix multiplication
You set uold = unew, but unew is 30x1 instead of 29x1. Since D(2:N,2:N) is 29x29, MATLAB errors in the next iteration when you ...

2 years ago | 0

Answered
Incorrect Dimensions for matrix multiplication
You multiply and divide arrays elementwise when you compute Rtf. Thus you have to use elementwise multiplication (.*) and elemen...

2 years ago | 0

Answered
How to use pdist2 command for distance calculation?
If you implement your own distance function for the haversine distance, you can use pdist2.

2 years ago | 0

Answered
Empty sym: 0-by-1
Use A = double(arrayfun(@(i)solve(GI(i),V),1:numel(P))) instead of A = solve(GI,V)

2 years ago | 0

| accepted

Answered
How to use a constraint on the output of a goal function?
You must ask yourself: How could the objective function become complex-valued ? Maybe you have a log(x) expression in it and the...

2 years ago | 0

| accepted

Answered
Objective function is returning Inf or NaN values at initial point. lsqcurvefit cannot continue.
Before you call lsqcurvefit, you should call your function "func" with the initial guess values for the parameters to see what i...

2 years ago | 0

| accepted

Load more