Answered
Use of fmincon to contain all data points with circle
rng("default") up_bound = 1000; x_r = -5 + (5+5)*rand(up_bound,2); tspan = [0 30]; f = @(t,y) [y(2);(1-y(1)^2)*y(2) - y(1)];...

3 years ago | 0

| accepted

Answered
taking the inverse of multiple matrix's
What am I doing wrong? Nothing. But some or all of the sigma matrices that you try to invert seem to be singular.

3 years ago | 0

| accepted

Answered
How to do the following two for loop?
You mean i=0.1:0.1:0.9 ; M = [i.',ones(numel(i),5)] ?

3 years ago | 0

| accepted

Answered
LINPROG requires the following inputs to be of data type double: 'f'.
y= readtable('y.crra.csv'); % 249 x 1 y=table2array(y); reg1=readtable('fitted.reg1.csv'); reg1=table2array(reg1); trareg1...

3 years ago | 0

| accepted

Answered
Undefined function or variable 'e'
@(x,y)exp(-(x.^2 +y.^2)).* (x.^2 +y.^2) instead of @(x,y)e^(-x.^2-y.^2)*(x.^2+y.^2)

3 years ago | 0

| accepted

Answered
Can't integrate function using Matlab
L_bar=25; sigma_d =[0.25, 0.5, 0.75, 1.0]; mu = log(L_bar) - 0.5*(sigma_d).^2; L_tilda = exp(mu); r = 0:100; for ii=1:nume...

3 years ago | 0

| accepted

Answered
Scaling of a system of coupled differential equation and is it possible?
If possible, use different units for physical parameters involved such that values like exp(-1.48e36*(x(1)^2)), exp(-6.0653e35*(...

3 years ago | 0

| accepted

Answered
Trouble superimposing two functions onto the same graph. One is correct, the other is incorrect.
y2 = cos(x)./(x.^2 + 1) - atan(x).*sin(x); instead of y2 = cos(x)/(x.^2 + 1) - atan(x).*sin(x); %% Define x variables x = ...

3 years ago | 1

| accepted

Answered
What does this script mean?
What is VN ? Where is the function "tauxZC2" ? As written, the code tries to find a value of x that minimizes (c/x*(1-1/(1+x)^t...

3 years ago | 0

| accepted

Answered
How to solve a non-linear optimization problem with matrix and vector decision variables?
I turned deltaB into a diagonal matrix. I changed m to 130 and it works. Are you sure a solution exists for m = 120 ? %% Input...

3 years ago | 1

| accepted

Answered
Issue with probability density function
histogram(Output,'Normalization', 'pdf');

3 years ago | 0

Answered
Hi, I would need the algebraicly solved two equations for X and Y of the intersection points of two circles to write them as algorithms in a graphics language. Thanks
syms x y x1 y1 x2 y2 r1 r2 real eqn1 = (x-x1)^2+(y-y1)^2==r1^2; eqn2 = (x-x2)^2+(y-y2)^2==r2^2; sol = solve([eqn1,eqn2],[x y]...

3 years ago | 0

Answered
Code for the Maximum likelihood esitmate for the gamma distribution , both parameters unknown
format long data = [27,82,115,126,155,161,243,294,340,384,457,680,855,877,974,1193,1340,1884,2558,15743]; p = mle(data,'Distri...

3 years ago | 0

Answered
2nd order differential equation
Use MATLAB's "pdepe" with m = 2 (radial coordinates).

3 years ago | 0

Answered
solve ODE using finite difference method
This is a PDE, not an ODE. Use "pdepe" to solve.

3 years ago | 0

Answered
Unable to meet integration tolerances without reducing the step size problem.
You define an initial condition for x(1) as 0, but you divide by x(1) in equations 1 and 2. This won't work.

3 years ago | 1

Answered
coupled ode for 2nd order
I didn't compare equations and boundary conditions with those listed above. % Defining parameters delta = 0.02; % L...

3 years ago | 1

Answered
Epicycloid curve calculating arch length using integral method
curvelength = vpaintegral(sqrt(diff(x,t)^2+diff(y,t)^2),t,0,T)

3 years ago | 0

| accepted

Answered
Find the value from the integral equation
fun = @(w,m0) (cos(4*w).*cos(4*w)+1)./(1+exp(w-m0)); m0sol = fsolve(@(m0)integral(@(w)fun(w,m0),-20,20)-2,1) integral(@(w)fun(...

3 years ago | 1

Answered
How to match indices of a matrix and how to define functions correctly in matlab
As you can see, Xnew is a 2x2 matrix. You want to assign a matrix to a vector in pos(i,:)=Xnew; which is not possible. Trace...

3 years ago | 0

Answered
maximisation of the utility function , portfolio optimization
Calculate W1*Rt1, W2*Rt2,...,W4*Rt4. Let Wi*Rti be maximum. Then (assuming gamma < 1) x_i = 1, x_j = 0 for i~=j is optimal.

3 years ago | 0

| accepted

Answered
Are there any restrictions on the Mass matrix for solving a DAE system using ode23t?
There are no restrictions on the mass matrix for ode23t or ode15s except for that it cannot be the zero matrix (which would mean...

3 years ago | 0

| accepted

Answered
Solving a non-linear system of equations
syms a b c d eq1 = ((a^2 * b) / (c^0.6 * d^0.7)) * 1.5 == 0.007484; eq2 = a + b + c + d == 1; eq3 = (((2*a) + (2*c)) / (b + c...

3 years ago | 0

| accepted

Answered
x values when taking a numerical derivative
Use n = numel(y); dydx(1) = (y(2) - y(1))/(x(2) - x(1)); dydx(2:n-1) = (y(3:n) - y(1:n-2))./(x(3:n) - x(1:n-2)); dydx(n...

3 years ago | 0

Answered
How do I make a column vector to add to my original matrix?
What about B = [4;-1;0] ?

3 years ago | 1

| accepted

Answered
How to find the orientation of the line of the intersection between two planes?
If you look at the next lines in Matt's code, he creates 100 points on the line. Thus in the modified code below, Pstart could ...

3 years ago | 2

Answered
BVP4c for three boundary set of boundary conditions
You didn't try to understand the code I provided for the similar problem, did you ? You still supply 6 initial conditions altho...

3 years ago | 1

Answered
Adding more boundary conditions to pdepe
So my question is that is it possible to set BCs at a and b. It depends what boundary conditions you want to set. If it is simp...

3 years ago | 0

| accepted

Answered
implicit function ,differeation
syms x y(x) D2y eqn = x + sin(y)/2 - y == 0 d2eqn = diff(eqn,x,2) d2eqn_subs = subs(d2eqn,diff(y,x,2),D2y) D2y = solve(d2eqn...

3 years ago | 0

Load more