Answered
How do I plot a multivariate piecewise continuous function?
Why don't you write a simple function for F with 4 if-statements for the 4 cases ? function value = F(x,y) if x ... && y ......

4 years ago | 0

Answered
Solving a 6th order non-linear differential equation in Matlab
I think that nobody in this forum will dive into selfmade software if there are well-tested MATLAB alternatives. So these few l...

4 years ago | 1

Answered
Periodic Boundary Conditions with pdepe
It is possible to use PBC with pdepe? No, sorry.

4 years ago | 0

Answered
Algorithm / Function to find weighting of parameters how influens on result
Seems exactly the opposite from what you presume is true: w = [5 4 9;2 3 0]\[80;30] [0 0 9;10 10 0]*w

4 years ago | 0

Answered
function input to solve ODE
% solve u'(t) = F(t,u(t)) where u = [u1(t), u2(t), u3(t)]' % using forward euler method % Initial conditions and setup neqn...

4 years ago | 0

Answered
I want to simulate the following programme on pdepe solver with third type inlet boundary of Heaviside nature with t0 = 140 days and a zero flux ourlet boundary
pl = ul - C0 * ( 1 + exp(-2*k*t0) )/( 1 + exp(2*k*(t-t0)) ); ql = 0.0; I suggest you plot the function f(t) = C0 * ( 1 + exp...

4 years ago | 0

| accepted

Answered
Subtraction between a matrix and a column vector
B = A - x where A is your matrix and x is your vector.

4 years ago | 1

Answered
Having problem with a infinite double sum
You might want to try a numerical solution: a = 2.0; b = 4.0; nu = 20; q0 = 1.0; X = linspace(-2*pi,2*pi,250); Y = linspac...

4 years ago | 1

Answered
Trigonometric functions using dsolve
fun = @(t,theta) [1+sin(theta(2))-theta(1);1+theta(3)-theta(2);theta(2)-theta(3)]; theta0 = [0.1, 0.3, 0.2]; tspan = [0,2*pi] ...

4 years ago | 0

Answered
convert matrix to array
A = A(:)

4 years ago | 0

Answered
Not enough input arguments from a row vector
function x = myquad(vec) a = vec(1); b = vec(2); c = vec(3); if b^2 - 4*a*c > 0 x = 2; else if b^2 - 4*a*c =...

4 years ago | 1

| accepted

Answered
How can I define a lower bound of the LP?
A = [1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;... 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

4 years ago | 0

Answered
Can this be integrated within MATLAB?
syms XC0 beta zeta f = XC0*zeta*(zeta+sym('1e-9'))^2/(zeta+sym('1e-9')+beta*XC0)^2 intf = int(f,zeta,0,1) Output: 2 ...

4 years ago | 0

Answered
Solving a highly non linear equation in Matlab
It's "only" an ODE of degree 6. Rewrite it as a system of first-order ODEs. You will need 6 initial or boundary conditions. De...

4 years ago | 0

| accepted

Answered
How can I resolve this problem?
The arrays "Ppost" and "ex" don't have the same number of elements. This has the effect that "ex" has less elements than the v...

4 years ago | 1

| accepted

Answered
reordering matrix elements according to another matrix
[A,index] = sortrows(A) B = B(index,:)

4 years ago | 0

| accepted

Answered
error with the integral of a imaginary array
L=integral(g,-Inf,Inf,'ArrayValued',true);

4 years ago | 0

Answered
Fitting a curve on normalized histogram
You can directly calculate the distribution of Z from the distribution of X and plot its PDF. Or do you only have a discrete nu...

4 years ago | 0

Answered
How to find all cycles of specified length of given graphs?
Find all cycles and evaluate their lengths afterwards separately: https://de.mathworks.com/help/matlab/ref/graph.allcycles.html...

4 years ago | 0

| accepted

Answered
How to solve 2d steady state PDE? Temperature is a function of radial and axial direction
Use MATLAB's "pdepe" and interprete the axial coordinate z as the time coordinate t.

4 years ago | 0

Answered
Proper way to write ode45
The usual way is to use arrays in which you can write and from which you can read variables at certain positions. Or you can us...

4 years ago | 1

| accepted

Answered
fminbnd not working for a single variable optimization problem
k1=fminbnd(@(k)valfun3(k,k0,z0,a0),kmin,kmax); instead of k1=fminbnd(@valfun3,kmin,kmax);

4 years ago | 0

| accepted

Answered
What to do with for-while loop?
number_on_dice = 6; bu = [ ]; while number_on_dice ~= 8 u = rand(); number_on_dice = sum(cdf <= u) + 1; bu = [b...

4 years ago | 0

Answered
Help regarding below question.
f = @(x) [functional equation] syms x df = diff(f,x); df_fun = matlabFunction(df); x = xstart:0.01:xend; % define interval ...

4 years ago | 0

Answered
Why ode45 returns NaN for a system of differential equations?
N = 10; Mi = zeros(N,1); c0 = zeros(N,1); Mi(1) = 14.01; c0(1) = 0.7809; Mi(2) = 16; c0(2) = 0.2095; Mi(3) = 39.95; c0(3...

4 years ago | 0

| accepted

Answered
calculate the rectified value
built_in_value = mean(abs(A(:)))

4 years ago | 1

| accepted

Answered
How to code a nonlinear vector-valued function so that it fits the coordinate grids (xq , yq) of triangles?
Here is the author's homepage: https://people.sc.fsu.edu/~jburkardt/ Just contact him.

4 years ago | 0

| accepted

Answered
Index in position 1 is invalid. Array indices must be positive integers or logical values. Error in explicitftcs (line 28) u(Nx+1,k) = 1.; >> u(Nx+1,k) = 1.; Index in
Nx should be the number of grid points in x-direction, not the length of these intervals. You mixed this up by setting Nx = 0.1...

4 years ago | 0

Answered
Extract positive value from solve function
If a and b contain no more symbolic constants, then you can use a = double(a); b = double(b); a = a(abs(imag(a)) < 1e-6); b ...

4 years ago | 0

Load more