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

Answered
How do I fit a sine curve with the least square fit?
Use "lsqcurvefit".

4 years ago | 0

Answered
How to solve a system of pdes coupled in their boundary condition
Ok, then the discretization at y = alpha should be for the nonlinear case (A(n+1)-A(n-1))/(2*dy)=-Bi_A * A(n)*A1(n)^2*B(1) (A1...

4 years ago | 0

| accepted

Answered
4th order Runge Kutta method for differential equations using a tolerance
I made the best of your code I could, but study carefully. There must be something wrong - I guess with the units. c = 3*10^10;...

4 years ago | 0

Answered
Operator '==' is not supported for operands of type 'function_handle'
Determine the roots of each polynomial separately using "roots". The roots of the product will be the union of the roots of th...

4 years ago | 1

Answered
How to find matrix S, given by this equation
L is NxN and 0_(N-1) is (N-1)x1 ? J_delta is a full (N-1)x(N-1) matrix ? Then use the eigenvector corresponding to the eigenval...

4 years ago | 0

Answered
Is there any way to solve an ineuality with syms?
You could try solving the equation psi - phi == 0 for r_t, but I doubt that MATLAB's "solve" will offer a solution.

4 years ago | 0

Answered
MATLAB gets the inverse of the matrix wrong
%Initial guesses: teta1=50; teta2=40; teta3=30; teta4=60; teta5=20; teta6=15; x1=0.2; y=0.65; x0 = [teta1, teta2, teta3...

4 years ago | 0

Answered
Find intersections of curves
bL = 0 is the intersection point. hold on plot(0,0,'.')

4 years ago | 0

Answered
Using "fminimax" in Matlab to solve the Max-Min programming problem
Yes, [0 0 0 0] is the correct solution to your problem. For all other c vectors >= 0, min g(x,c) would be negative. Since your...

4 years ago | 1

| accepted

Answered
Graphing a 2nd order ODE
function dydt = order2(t,y) dydt = zeros(size(y)); a = 2.4; %coefficient for y. term b = 1.44; %coefficient for y term m ...

4 years ago | 0

Answered
how can I create meshgrid of given data?
Use "ndgrid" instead of "meshgrid". "meshgrid" is for 2d- and 3d-grids.

4 years ago | 1

| accepted

Answered
Solving for two variables using 4th order Runga Kutta Method
Define your functions for du/dr and dt/dr in the line f = @(r,y) ... and adapt the settings in the calling program according to ...

4 years ago | 0

Load more