Answered
Can someone explain why I am getting the error "Not enough input arguments (line 26)"?
[M,y] = Newton_3(@my_func,@my_func_pr,0.1,0.001,1e6); function [M,y]=Newton_3(fun,fun_pr,M1,tol,max) % Find zero near x1 usi...

4 years ago | 1

| accepted

Answered
Error using Nonlcon: "Not Enough Input Arguments"
[x,fval,exitflag,output,population] = ga(fitnessfcn,nvars,A,b,Aeq,beq,Lb,Ub,@nonlcon,intcon); instead of [x,fval,exitflag,outp...

4 years ago | 1

Answered
Problem with my forward euler scheme
%parameters c = 0.05; %Velocity Nx = 50; % Number of spatial steps xl = 0; % Left boundary xr = 4; ...

4 years ago | 0

| accepted

Answered
Matrix Dimensions must agree.. Help Please
You work with vectors. So you must use v = (g./f).*dh_x./dx; % Meridional geostrophic velocity v u = -(g./f).*dh_y./dy...

4 years ago | 0

Answered
Is there a way to get a higher order polynomial fit for a surface than poly55
You can define the fitting polynomial by yourself. Everything is allowed, but does it really make sense to use polynomials of de...

4 years ago | 0

| accepted

Answered
Forward Euler method error
Array indices in MATLAB start at 1, not at 0. Thus you will have to replace x(0)=1 y(0)=0 by x(1)=1 y(1)=0 And you sol...

4 years ago | 0

| accepted

Answered
Fitting rigid bodys of 3 coordinates in 2D. Minimization with fminsearch does not work for optimization
You forgot to square the difference between the two triangles.

4 years ago | 1

| accepted

Answered
using solve to solve equation with fractional power?
There are no analytical expressions for the roots if a polynomial of degree >= 5. So there is nothing you can do but to give nu...

4 years ago | 0

Answered
What does the 'greater then' symbol mean if it is after an equality?
The logical expression x*w(:,2) > x*w(:,1) is a vector of length size(w,1) and evaluates to 1 if x*w(i,2) > x*w(i,1) and to 0...

4 years ago | 1

Answered
converting row and column
By default, all one-dimensional vectors are row vectors. But if you initialize Kc as a column vector, you'll get Kc a column ve...

4 years ago | 1

| accepted

Answered
Solve the following simultaneous equations:
theta=0.10895; YF=0.0667; alpha= 0.29; beta= 0.68; gamma1=450; gamma2=11.25; X0=0; Y0=0.0667; Z0=0; f=@(t,y)[-y(1)/theta+...

4 years ago | 1

Answered
Solve an equation with matrices
syms tii too tc q rh eqn = (tii-too) == q*rh*log((tc-too)/(tc-tii)); tc = solve(eqn,tc); Tc = double(subs(tc,[tii,too,q,rh],[...

4 years ago | 1

Answered
How to generate random numbers with constraint?
a = (1.2-0.05)*rand(25,1)+0.05; a = sort(a,'descend')

4 years ago | 0

| accepted

Answered
The result of the integral is not precise enough to draw curves. How can I fix this ?
syms t beta=0.7; tau=1; F = exp(-(t/tau)^beta) f= diff(F,t) f = matlabFunction(f) %Calcul de l'intégrale M a = -3.0: 0...

4 years ago | 1

| accepted

Answered
Finding the function corresponds to the minimum residual
resmin = Inf; fmin = []; for i = 1: length(alphaarray) alpha = alphaarray(i); f = fine(K1,K2,Mmeas,alpha); res...

4 years ago | 1

Answered
curve fitting tool command
Do you have a license for the Curve Fitting toolbox ? Try status = license('test','Curve_Fitting_Toolbox') It should return ...

4 years ago | 0

Answered
Summation with Nested For Loop
theta_doa = 0:20:360; theta_m = [0 60 144 216 288]; c_square = zeros(1,numel(theta_doa)); for i = 1:numel(theta_doa) for...

4 years ago | 0

| accepted

Answered
Unable to perform assignment because the left and right sides have a different number of elements.
Only Schwerpunkte_X(i) = Schwerp_X(i,1); is possible since "Schwerpunkte_X(i)" is a scalar (one single value) which cannot be...

4 years ago | 0

Answered
Solving an initial value problem for a PDE
The method of characteristics gives the equations dt/ds = 1, t(0) = 0 dx/ds = u, x(0) = x0 du/ds = 0, u(0) = phi(x0) with s...

4 years ago | 0

Answered
How can I calculate the value in an equation?
I don't see a root: gamma=1.4 V_M_2 = 20; fun = @(M_2)V_M_2 - (sqrt((gamma+1)/(gamma-1)) * atan(sqrt((gamma-1)/(gamma+1)*(M_2...

4 years ago | 1

Answered
Determining Whether Symbolic Polynomials Are Linear
You will have to check the two properties of a linear function: f(x+y) = f(x) + f(y) f(a*x) = a*f(x) for symbolic variables x...

4 years ago | 0

Answered
6th order differential equation [bvp5c issue]
You divide by F(1)^3. For the function F to be well-behaved at eta = 1, you must have that 5*F(1)-4*F(2)-27*F(1)^2*F(2)*F(6) ...

4 years ago | 0

Answered
Automatically find all roots of a function using bisect method
Choose delta small, e.g. 0.01. Evaluate f at -4 and at -4+delta. If f(-4)*f(-4+delta) <=0, there will be a root in between. I...

4 years ago | 0

Answered
How to use lingprog() when there are more constraints than variables?
What variables are design variables, which variables are fixed and given ? If you insert the constraint R*f = p and R, f and b ...

4 years ago | 0

| accepted

Answered
Extracting an extra Matrix from ode45 solver
y0 = [0.1;0.3;0.1;1;0;0;0]; tspan = [0 20]; [t,y] = ode45(@ODEsystem,tspan,y0); eta_d = cos(sin(t)/2); Extracted.

4 years ago | 1

| accepted

Answered
What does it mean to take the absolute of an complex number? And why is it always positive?
abs(z) where z=x+i*y is the distance of the point (x/y) from the point (0/0), thus always >=0 and =0 only if z = 0.

4 years ago | 1

Answered
How to fixed matrix dimensions
[m,n] = size(A); Sc = sum(A,1); Sr = sum(A,2); if (Sc == ones(1,n)) & (Sr == ones(m,1)) disp('Correct') else disp(...

4 years ago | 1

| accepted

Answered
Problems with fminsearch giving startvalues as result
polynom_1 = @(variable_1,variable2) polynom(variable_1,variable2,input_1,input_2,..,input_n); polynom_2 = @(variable_1,variable...

4 years ago | 0

Answered
How to check 0 and 1 at matrix every row and column?
[m,n] = size(A); Sc = sum(A,1); Sr = sum(A,2); if (Sc == ones(1,n)) & (Sr == ones(m,1)) disp('Correct') else disp(...

4 years ago | 1

| accepted

Answered
Why am I getting "Array indices must be positive integers or logical values" ?
RBg3(m3(ag3y(i) - ag3x(i))) RBg3(m4(ag4y(i) - ag4x(i))) RBg3(m5*ag5y(i)) only works if RBg3 and m3,m4 are functions. It does ...

4 years ago | 0

Load more