Answered
Function value and YDATA sizes are not equal using lsqcurvefit
The integrator was not able to integrate your system of differential equations. So there was no or only an incomplete solution r...

4 years ago | 0

| accepted

Answered
Solving system of 3 non-linear equation with dynamic equality output
syms x1 x2 x3 t A eqns = [ x1 == t*(10*abs((18*x2)/125 - (24*x1)/125 + 111/50)^2*sign((18*x2)/125 - (24*x1)/125 + 111/50) ...

4 years ago | 0

| accepted

Answered
Error in function interp1: Sample points must be unique.
You can use unique() to get rid of duplicate sample points. It will also sort them.

4 years ago | 1

Answered
Solving a System Consisting of PDEs & ODEs using Method of lines
What's wrong with the results ? The fact that Ca becomes negative ? L = 5; % length of reactor v = linspace(0,L,100).'; % di...

4 years ago | 0

| accepted

Answered
Error using integral; First input argument must be a function handle.
function z= continum(var,energy) z = integral(@(x)cont(var,x),2.39,inf); end

4 years ago | 0

Answered
Summing anonymous functions in a for loop: adding penalty terms for optimization
basefun returns a vector of size (8x1) . Now to each component of this vector you add the sum of the following scalar values la...

4 years ago | 0

| accepted

Answered
Does MATLAB have a feature to show step-by-step solution?
m = 5; B0 = 1; B = fsolve(@(B)fun(B,m),B0) fun(B,m) function res = fun(B,m) B sum1 = 0.0; sum2 = 0.0; for j=0:m-1 ...

4 years ago | 0

Answered
Need help to program the hypergeom function
https://de.mathworks.com/help/symbolic/hypergeom.html

4 years ago | 1

Answered
Create random numbers inside a specific plane in xy plane
rng("default") x = [2;8]; y = [1;2]; R = rand(2,400) S = [x(1);y(1)]+[[x(2)-x(1);0],[0;y(2)-y(1)]]*R

4 years ago | 0

Answered
How do i write CO2 emission constraint?
Every M_CO2^t will be a solution variable x(i) in your optimization. So setting the constraints -(x(i)-x(i-1)) <= 0 for i <=...

4 years ago | 0

| accepted

Answered
Finding the coordinates of a point given the gradient, distance and one set of coordinates
m = 0.4; x1 = 10; y1 = 4; s = 15; z = [x1 y1] + s/sqrt(1+m^2)*[1 m]; x2 = z(1) y2 = z(2)

4 years ago | 0

| accepted

Answered
Model of two differential equations of RLC circuit (Simulink)
Solve the system of differential equations dI1/dt = i1, I1(0) = 0 dI3/dt = i3, I3(0) = 0 L*di1/dt = U - R*i1 - 1/c * I1 - 1/c...

4 years ago | 0

Answered
Curve fit app displays wrong curve
pc = [ 1.8513e+03 3.6393e+03 3.7146e+03 3.7914e+03 3.8699e+03 3.9500e+03 4.0317e+03 4.1151e...

4 years ago | 0

Answered
how to set a range of data instead of percentile?
https://de.mathworks.com/help/matlab/ref/isoutlier.html

4 years ago | 0

| accepted

Answered
unable to use solve or fsolve for linear system
Seems your equations are not independent. syms R1 R2 R3 R4 COM = [-6,0,10]; r1 = [-54.2,-27.5,-16.4]; r2 = [-54.2,27.5,-16.4...

4 years ago | 0

| accepted

Answered
Implementing implicit method for system of ODEs
n = 50; % number of time steps t0 = 0; % initial time T = 2*pi; % final time dt = (T-t0)/n; % size of timestep y0 = [1;0]; %...

4 years ago | 0

Answered
reflection of a curve with respect to a plane
x = -1:0.2:10; y = x.^2 + 2; z = zeros(size(x)); P = [2 2 2]; V = [0 0 1]; d = (P.' - [x;y;z]).' * V.'; Ps = [x;y;z] + 2*V...

4 years ago | 0

| accepted

Answered
where is the error in my code?
V1 = @(r,w) -acosh(10*(w/(1600*r + 21))^(1/2))/20000000000; V2 = @(r,w) acosh(10*(w/(1600*r + 21))^(1/2))/20000000000; % Defin...

4 years ago | 0

Answered
I have three coupled differential equation and need help to solve them
You have a linear system of equations in dx/dt, dy/dt and dz/dt. Solve it for these variables. Then you can write your system e...

4 years ago | 1

Answered
Unable to convert the following expression into double array
clc; clear all; close all; al = 0.5; n = 5; sig2_fsnrn = 1; sig2_ksln = 1; sig2_glnrn = 10; sig2_e_fsnrn = 0; sig2...

4 years ago | 0

Answered
Can't get the solution on this nonlinear system of equations using vpasolve
For that your two equations can have a solution, one can show that abs((PX^2+PY^2-l1^2-L2^2)/(2*l1*L2)) must be <= 1. This i...

4 years ago | 0

| accepted

Answered
How to load intermediate variable into workspace while using ode45 ?
tspan = 1:200; x0 = zeros(38,1); [t,x] = ode45(@system, tspan,x0); ts=40; ssActive = [1,2,3,4,1,3,4,2,4,3,3,4,3,3,1,2,3,4,1,...

4 years ago | 0

Answered
[f,x]=ecdf(y) definationf of x
https://de.mathworks.com/help/stats/ecdf.html There are six literature reference at the bottom of the page. Usually, the minim...

4 years ago | 0

| accepted

Answered
trying to use the fmincon function
Works for me after changing "fun" in "@fun": % script calling fmincon start clc clear all x0=[-1...

4 years ago | 0

| accepted

Answered
How to generate all possible vectors where each element can take one of two values
Generate all possible combinations of 0 and 1: m = 3; justRows = dec2bin(0:2^m-1)-'0' Now replace the 0's by a(i) and the 1 b...

4 years ago | 1

Answered
Local minima of an interpolant fit
Pass the evaluating function for the interpolant as objective function to fminsearch or another optimizer (fmincon,...). E.g. ...

4 years ago | 0

Answered
How can plot 1D manifold in 3d space
syms x y z p=0.255*z.^2./(z.^2+(0.055)^2); m1=0.15^2./(p.^2+0.15^2); m2=z.^4./(z.^4+0.1^4); m3=p.^2/(p.^2+0.15^2); g = 0.05...

4 years ago | 0

| accepted

Answered
How to create a function that can work out an input provided the output and and all other variables are known?
Use "fzero" or "fsolve" to solve G(x) := f(L1,l1,h1) - f(random L2, x, random h2) = 0 for x.

4 years ago | 0

| accepted

Answered
Workaround for the expinv function in statistics toolbox
p = 0.3; mu = 1/4; x = -mu.*log(1-p) x2 = expinv(p,mu)

4 years ago | 0

| accepted

Answered
Creating a matrix for a function
A = [ones(numel(t),1),sin(t),cos(t),sin(2*t),cos(2*t)]

4 years ago | 0

| accepted

Load more