Answered
How to get 3D histogram with marginal histograms
https://stats.stackexchange.com/questions/24568/normalizing-a-2d-histogram-and-getting-the-marginals

4 years ago | 0

Answered
How to solve 2nd order DE with Explicit Euler method?
g = 9.81; L = 1.0; T = 1.0; dt = 0.01; y_0 = pi/2; v_0 = 0; f = @(t,y)[y(2),-g/L*sin(y(1))]; t = (0:dt:T).'; nt = nu...

4 years ago | 0

| accepted

Answered
MATLAB PDE BC'S
function [pl,ql,pr,qr] = heatbc(xl,ul,xr,ur,t) Nu = 1.0; % left Bc = ul pl = 0; ql = 1; % right BC= ur pr = Nu*ur; qr =...

4 years ago | 0

Answered
Multiple fminbnd errors with a parametrized function
You are in the realm of numerical, not symbolic computations. Here, functions are defined as handles: fun = @(t) exp(cos(t)) -...

4 years ago | 1

| accepted

Answered
Finite difference method to solve a nonlinear eqn?
g = 9.81; L = 1.0; T = 1.0; dT = 0.01; y_0 = pi/2; v_0 = 0; f = @(t,y)[y(2);-g/L*sin(y(1))]; tspan = 0:dT:T; y0 = [y_0...

4 years ago | 0

| accepted

Answered
Integral of a matrix (x = integration(v)dt) to find x in each time step - how to get it?
After replacing the NaN values in the matrix, just do T = [5 5.005 5.015 5.020 5.025]; A = [0.223886255942431 0.76659480876201...

4 years ago | 0

| accepted

Answered
Generate Random Numbers to satisfy a variable on the left and right hand side
Here is a code with which you get M2 versus M1 curves for the vector P01 of pressures for which the relation Ctheta_exitvolute...

4 years ago | 0

Answered
too many input arguments when using pdepe
sol = pdepe(m,@(x,t,u,dudx) wave_ode1(x,t,u,dudx,p),@pdeic2,@pdebc2,x,t); function [c,f,s] = wave_ode1(x,t,u,dudx,p) % Equati...

4 years ago | 0

| accepted

Answered
iUsing ode45, how to pass a parameter from odefun to an events function?
You'll have to calculate loadfV twice if you don't want to use globals. But you should use a third function different from BD_i...

4 years ago | 0

| accepted

Answered
How to get back the original matrix?
A = [1 2 3 2;... 4 1 2 3;... 3 4 3 2;... 2 4 1 1] R = [1 3 4 2]; B = A(R,:); Rinv(R) = 1:numel(R); A_recovere...

4 years ago | 1

| accepted

Answered
2 equations one unknown
v = sqrt(95*9.8/0.24)*tanh(sqrt(0.24*9.8/95)*8) y = 95/0.24*log(cosh(sqrt(0.24*9.8/95)*8))

4 years ago | 1

Answered
"Error using vertcat Dimensions of arrays being concatenated are not consistent." why this error showing?
function "my_ode" lacks an "end" statement.

4 years ago | 1

Answered
I want to get the values from the last two iteration
% Tolerances, Maximum number of iterations tolF = 1e-6; tolX = 1e-8; itermax = 30; % Start values xim2 = 6; ...

4 years ago | 0

Answered
How to get the output result from a jacobian as this.
jac = subs(jac,[X1,X2,X3,X4,X5,X6,X7],[X0(1),X0(2),X0(3),X0(4),X0(5),X0(6),X0(7)])

4 years ago | 0

| accepted

Answered
Calling a function inside an integration
t = 36:1:64; v = 7.65; h = 435; r = tand(15)*h; lambda = 0.21; Aeff = 0.57; for i = 1:length(t) yi = r - v*(t(i)); ...

4 years ago | 1

| accepted

Answered
how to set a loop to calculate time
t0 = 0.01; n = log(24/t0)/log(1.1); t = t0*1.1.^(0:floor(n)); t(end+1) = 24.0;

4 years ago | 0

| accepted

Answered
Store elements of a matrix but ONLY IF the respective element of ANOTHER matrix meets condition.
matriz_viaveis = NaN(size(matriz_angulodecarga)); for x= 1:size(matriz_angulodecarga,1) for y = 1:size(matriz_angulodecarg...

4 years ago | 1

Answered
Unable to perform assignment because the left and right sides have a different number of elements.
t=linspace(0,50,501); vel=zeros(1,501); %d=zeros(1,501); dT = zeros(1,501); dT(1) = 0.1; vel(1) = 20; for n=1:500 if ...

4 years ago | 0

Answered
Unable to perform assignment because the indices on the left side are not compatible with the size of the right side
I doubt that "computeF1clustering" returns one single real number, does it ? That's what you assume when you try to write the r...

4 years ago | 0

Answered
Saving to Arrays in for loop
Qe = 12; M = 1002; aArr = zeros(M,1); eArr = zeros(M,1); daArr = zeros(M-1,1); deArr = zeros(M-1,1); T = [0:1000]; eArr(1...

4 years ago | 0

| accepted

Answered
How to specify a 3 element column vector in Euler's Method for ODE
Here is a hint: https://de.mathworks.com/matlabcentral/answers/1676979-how-do-i-use-euler-s-forward-difference-method-and-the-s...

4 years ago | 0

| accepted

Answered
Numerical integration (vpaintegral) of bessel function of the second kind (bessely)
Plot bessely(1,rho) in the interval [0,1]. Seems there is a singularity at x=0.

4 years ago | 1

Answered
trigonometric equation solution help
When I plot the function for several values of err and space, I only see a zero at k=0 and k=0.5. Can you give values for err a...

4 years ago | 0

| accepted

Answered
How to get a loop to converge
And what do you want to get with J_BF_inB(q*b) ? q*b at the first place is undefined. And even if it were defined, what is M...

4 years ago | 0

Answered
Optimization Toolbox Defining Constraints
https://de.mathworks.com/help/optim/problem-based-approach.html And better use "intlinprog" instead of the "ga" - solver if the...

4 years ago | 0

| accepted

Answered
plotting a function which is an Integral
a=1; fun = @(z,x) z.^a./sinh(z).*1./(x.^2+z.^2); X = 0:0.1:50; for i = 1:numel(X) x = X(i); F(i) = x*sin(x)*integra...

4 years ago | 0

| accepted

Answered
I have 2 independent variables and one dependent variable. I would like to get a polynomial equation and surface plot passing through the data points?
M = [0.970446735 0.068181818 0.2 0.894959908 0.068181818 0.4 0.779725086 0.068181818 0.6 0.61489118 0.068181818 0...

4 years ago | 0

| accepted

Answered
Hi! I want to make a 2D random walk that can run multiple times, and I also want to record the final destination of each walk.
NUMSTEP = 1000; NUMWALK = 100; xfinal = zeros(NUMWALK,1); yfinal = zeros(NUMWALK,1) for i = 1:NUMWALK x = 0; y = 0...

4 years ago | 0

| accepted

Load more