Respondida
simple x.y plot
Use y = (4*(x.^2)*log(6))+(5*(x.^2)) ./ sqrt (cos(x).^2) +1 instead of y = (4*(x^2)*log(6))+(5*(x^2)) / sqrt (cos(x).^2) +1...

más de 2 años hace | 0

Respondida
I'm receiving this error: "Incorrect number or types of inputs or outputs for function int." when trying to run the following code. I think because of the symbolic variables
syms a1 a2 a3 a4 theta dzdx = a1*pi*cos(.5*pi*(1-cos(theta))) + 2*a2*pi*cos(pi*(1-cos(theta))) + 3*a3*pi*cos(1.5*pi*(1-cos(the...

más de 2 años hace | 0

| aceptada

Respondida
Assumptions are not being considered in symbolic math.
What is rank(A) ? If it's 8, your system of equations has a unique solution, and you can't assume anything about it.

más de 2 años hace | 3

Respondida
Need help to fit the data without error.
I assumed you start integration at x = 5.3571429. You will need to specify dr/dx and dtheta/dx in the y0-vector below. rData =...

más de 2 años hace | 0

Respondida
Do ODE solvers use location of root of event function in its solution even if integration isn't specified to stop?
You will have to tell the solver to return control to the calling program once the corner point is reached. From there, you can ...

más de 2 años hace | 0

| aceptada

Respondida
How to debug this? Not getting into it. Need help
Use fit = lsqcurvefit(@(params, x) funr(params, x), initialGuess, rData(:,1).', rData(:,2).'); fit2 = lsqcurvefit(@(params, x)...

más de 2 años hace | 0

Respondida
role of flux f in bcfun of pdepe for systems of PDEs
This multiplication is nowhere performed within "pdepe". But if you look at the pdepe code below, the cases where q = 0 and q di...

más de 2 años hace | 0

| aceptada

Respondida
Logit panel with Simulated Maximum Likelihood. Convergence question with fminunc
Your objective function depends on random values. This is not allowed for deterministic optimization as done by "fminunc". Conve...

más de 2 años hace | 2

| aceptada

Respondida
It keeps giving me an error on line 4, saying I'm missing input arguments but I have everything defined?
Q = 9.4e-6; q = 2.4e-5; R=0.1; epsilon= 0.885e-12; F=@(z)(Q*q*z) .*((1-z)./(sqrt(z.^2+R.^2)))/(2*epsilon); z1 = 0.5; z2 =...

más de 2 años hace | 0

| aceptada

Respondida
GA does not solve problems with integer and equality constraints
Your code from above works for me. Test it. Because you only have inequality constraints, you must set h = [] instead of h = z...

más de 2 años hace | 0

| aceptada

Respondida
Solving equations using Newton-Raphson method for 7 equations with 7 variables
You have a linear system of equations. No Newton method is required in this case. But since a only has rank 2, no solution exis...

más de 2 años hace | 0

Respondida
Using lsqnonneg to determine if there exists a solution to a (generally) under-determined linear system, but error is too large to be convincing.
If you are convinced that there should exist a "true" solution for your system, extract a matrix of size (10x10) that is non-sin...

más de 2 años hace | 0

Respondida
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...

más de 2 años hace | 1

Respondida
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...

más de 2 años hace | 0

Respondida
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; ...

más de 2 años hace | 2

Respondida
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...

más de 2 años hace | 0

| aceptada

Respondida
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...

más de 2 años hace | 0

Respondida
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 ...

más de 2 años hace | 1

Respondida
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...

más de 2 años hace | 0

Respondida
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...

más de 2 años hace | 0

| aceptada

Respondida
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...

más de 2 años hace | 0

Respondida
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.

más de 2 años hace | 0

Respondida
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...

más de 2 años hace | 1

Respondida
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 =...;...

más de 2 años hace | 1

Respondida
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...

más de 2 años hace | 0

| aceptada

Respondida
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)...

más de 2 años hace | 0

| aceptada

Respondida
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...

más de 2 años hace | 0

Respondida
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'...

más de 2 años hace | 0

| aceptada

Respondida
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...

más de 2 años hace | 0

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

más de 2 años hace | 1

| aceptada

Cargar más