Answered
Why am I getting the error "Too many output arguments"?
You don't initialize "error" in your code by giving it a value before you use it in the while loop. That's why MATLAB assumes e...

2 years ago | 1

Answered
I get an error using fminsearch and says Simulink model "model ex3" was called with incorrect number of arguments. I have attached a picture to show it.
Try calling fminsearch as [xSolution,fval] = fminsearch(@(x)model_ex3(x,par),x0) If this doesn't work, we need to know the inp...

2 years ago | 0

Answered
How to simplify infinite double matrix summation in Matlab.
Are you sure that the matrix potentials for A and R are meant elementwise ? beta = 1.5; A = [1 0;0 2]; R = [0 3; 1 1]; t = 1; ...

2 years ago | 2

Answered
How to convert the attached equations in Matlab?
I'm not sure if you mean m.^2.*f.^2./16.*r or m.^2.*f.^2./(16.*r) in your equations. I assumed that your equations.png is corr...

2 years ago | 0

| accepted

Answered
solvepde function MATLAB "c" term identification
https://uk.mathworks.com/help/pde/ug/c-coefficient-for-systems-for-specifycoefficients.html Chapter Definition of the c Tensor...

2 years ago | 0

Answered
How do I calculate the cross product of two vectors, when the first vector is an element of a N-array and the second vector is an element of an NxD matrix;
r1 = rand(30,3); r2 = rand(30,50,3); for i=1:30 for j=1:50 c(i,j,:)=cross(r1(i,:),squeeze(r2(i,j,:))); end ...

2 years ago | 1

Answered
How to apply loop on following case?
Make a function of the part of the code that you have to run through three times and call this function for IP_OPT, IS_OPT and R...

2 years ago | 0

Answered
Pdepe cylindrical coordinates with Neumann BC
You will have to use pl = P * (interp1(NP1(:,1), NP1(:,2), t, 'spline', 'extrap') - (cl/Kav)); ql = 1; %ignored by sol...

2 years ago | 0

| accepted

Answered
Find a weight matrix and bias which performs the following binary classification
Write your own hardlim function (see below) or license the Deep Learning Toolbox. N = -1+2*rand(10,5) S1 = my_hardlim(N) fu...

2 years ago | 0

Answered
PDE Model Boundary Conditions
If you output state.x and state.y in the function, you can see to which evaluation points state.u belongs.

2 years ago | 0

Answered
How to supply Hessian for interior-point in fmincon in the objective function and not a separate function
I didn't think until the end, but maybe this procedure also helps in your case: https://uk.mathworks.com/help/optim/ug/objectiv...

2 years ago | 1

Answered
optimising a parameter not directly involved in the objective function to be minimised
t_exp = ...; Cb_exp = ...; % experimental data KA =...; KV =...; p =...; D =...; Cs =...; mo =...; Ni =...; V =...;...

2 years ago | 1

Answered
Monte-Carlo Analysis of fmincon optimization is converging to infeasible point
I guess log((MC(1) - x(7)) becomes complex-valued because MC(1)-x(7) becomes negative. Complex-valued constraints have to be avo...

2 years ago | 0

| accepted

Answered
Solving system of coupled nonlinear discretized equations with fsolve using boundary conditions
Use "bvp4c". Additionally, I don't understand why you set F(z,1)=(N_H2O(z+1)-N_H2O(z-1))/(2*dz); F(z,2)=(N_H2(z+1)...

2 years ago | 0

| accepted

Answered
I want to solve the Lyapunov equation with matlab
You can also do it this way, but your system does not seem to have a solution: % Définition des matrices du système A = [0 1;0...

2 years ago | 0

Answered
When I test this code which is shown below. I got an error of " not enough input arguements". How can i solve this error?
ga will call your function "power_flow_cap" with one input argument. Your function has three inputs (capsz,ncap,capplc). I don'...

2 years ago | 0

| accepted

Answered
How to perform correct numerical integration of equations containing Bessel functions ?
I suspect you want exp(-zeta^2/(4*0.0277)) instead of exp(zeta^2/(4*0.0277)) in your integrand. And why do you add the same Bes...

2 years ago | 0

Answered
Trouble with fmincon - minimizing a vector
The appropriate objective is to minimize -sum(similiarityvalues.^2)

2 years ago | 1

| accepted

Answered
Get solution for a linked multi-stage BVP
How do I model this problem? By solving it as a multipoint boundary value problem: https://uk.mathworks.com/help/matlab/math/s...

2 years ago | 0

| accepted

Answered
Boundary Value Problem based on specific problem
x(0) = 0 gives C1 = 0, x'(0) = 0 gives C2 = 0. Thus the solution of your equation is x = 0 for all t.

2 years ago | 1

| accepted

Answered
odeToVectorField takes forever to run
Are you sure you want to differentiate with respect to functions of t (like theta1, theta1_dot, theta2_dot) ? drn1 = diff(r1,th...

2 years ago | 0

Answered
Solve second-order ODE with Robin boundary condition
syms x y(x) A B C a b dy = diff(y,x); eqn = diff(x^2*dy,x)-2*y == 0; cond1 = A*dy(a)+B*y(a)/a == 0; cond2 = A*dy(b)+B*y(b)/b...

2 years ago | 0

| accepted

Answered
I want to solve the Lyapunov equation with matlab
Use MATLAB's "lyap" or "dlyap".

2 years ago | 0

Answered
Is matlab able to solve a system of coupled PDE and ODE?
Setting c = 0 in "pdefun" deletes the time derivative of the respective equation and makes the equation an elliptic one. But y...

2 years ago | 0

Answered
graph is the not plotted as desired because of tolerance level
dydx(5) = (-t4./(1-1i.*H1)).*y(4); instead of dydx(5) = (-t4./(1-1i.*H1)).*y(3); in your function definition. I didn't look...

2 years ago | 0

| accepted

Answered
Having trouble with lsqcurvefit for a heat transfer experiment.
The calls to lsqcurvefit must be h_freebrass = lsqcurvefit(T_free_brass2,10,x,T_free_brass) h_freecopper = lsqcurvefit(T_free_...

2 years ago | 0

Answered
Error using pdepe Unexpected output of PDEFUN. For this problem PDEFUN must return three column vectors of length 2
The size of "f" is 4x1 instead of 2x1 (see above). Further, if your x-mesg starts at r=0 and you choose m=2, it must hold that ...

2 years ago | 0

| accepted

Answered
How can I plot a graph by varying two parameters a and b in system of ODE at the same time?
A = [1;2;3]; B = [2;3;4]; C = 10000; d = 2; e = 5; g = 1; tspan = [0 5]; for i = 1:numel(A) a = A(i); b = B(i);...

2 years ago | 1

| accepted

Answered
How to find same values in a randi function
Hand = randi(13,[1,5]) arrayfun(@(i)nnz(Hand==i),1:13)

2 years ago | 0

Answered
how can I calculate my expression with double integration?
Maybe you mean this, but I'm not sure: D = 100; e_f = 1.88e-18; m = 9.11e-31; k_b = 1.38e-23; h_bar = 1.05e-34; ksi = 1e-9...

2 years ago | 0

Load more