Answered
for loop with ode45 function
Look at what your loop does with the array k_l. k_l is set to [1 2] before the loop. For ii=1, the command k_l = k_l(1) set...

4 years ago | 0

Answered
how to loop equations
denominator = sum(1./dmm); d = l/denominator;

4 years ago | 0

Answered
Evaluating integration using value of integral at point
c1 = double(subs(M_final_first,x,0.865))

4 years ago | 0

| accepted

Answered
for loop forward modelling
% pre-defined constants: x(1) = -100; x(2) = 100; y(1) = -100; y(2) = 100; z(1) = -100; z(2) = -200; xp = 0; yp = 0; zp...

4 years ago | 0

Answered
Passing time step of ODE solver to odefunction for stochastic simulation
My ODE function need the actual step length at runtime to simulate brownian motion in my dynamic system. The usual approach is t...

4 years ago | 0

Answered
Relation between two vectors elements
Determine the permutation matrix P for which P*A = B: A = [1 2 3 4 5 6 7 8 9 10].'; B = [4 7 8 2 1 10 3 5 9 6].'; P = bsxfun(...

4 years ago | 0

| accepted

Answered
find varible inside qustion
The error message says that you did not give a value to the variable TMSR1. That's why MATLAB cannot evaluate the expression ...

4 years ago | 0

Answered
Can you solve partial differential equations using ode?
http://www.scholarpedia.org/article/Method_of_lines/example_implementation

4 years ago | 0

Answered
How to delete row between a certain value in one column and a certain event in the second column?
A= [560 0 ; 570 0; 580 0; 590 0; 600 0; 610 0; 620 0; 630 0; 640 1; 650 1; 660 0; 670 0; 680 0; 690 1; 700 0]; idx = find(A(:,1...

4 years ago | 0

| accepted

Answered
Solving system of 2 nonlinear higher order coupled equation
You won't get an analytical solution for this problem using "dsolve". Use bvp4c instead.

4 years ago | 0

Answered
Solving transcendental equation numerically
Your code returns NaN or +/- Inf when trying to evaluate equation (9.79) for the constants you gave. Before you do not solve th...

4 years ago | 0

Answered
Plotting a multivariate polynomial with sdpvar variables
https://de.mathworks.com/help/symbolic/ezplot.html Or make f a function handle: f = matlabFunction(f); z = f(x1,x2); surf(x1...

4 years ago | 0

Answered
take a sum in a matrix and print it on a different row
A = process time vector (as a column vector) B = zeros(numel(A),3); B(:,1) = A(:,1); C = cumsum(B(:,1)); B(2:end,2) = C(1:en...

4 years ago | 0

Answered
Use solve function and return with [0*1 sym]
syms s w r y b eq = s-((s - w)*(r + 1)^(1 - 1/y))/b^(1/y)==0 ; sol = solve(eq,s)

4 years ago | 1

Answered
I want to take time derivative of the function
link3_linear = sqrt((r_x - r2*cos(theta)).^2 + (r_y - r2*sin(theta).^2)) d_link3_linear_dt = diff(link3_linear,t) d_theta_dt ...

4 years ago | 0

| accepted

Answered
Error using odeset (line 231) Unrecognized property name 'mass_matrix_without_tld'. Error in my_ode_solver_without_tld (line 8) opts = odeset('mass_matrix_without_tld',@(t,y)
Because the property 'mass_matrix_without_tld' does not exist for the ODE solvers. Maybe you mean the existing property 'Ma...

4 years ago | 0

Answered
midpoint method iteration code error
f=inline('x^3-50*cos(x)-10*exp(-0.50*x)','x'); instead of f=inline('x^3-50*cos(x)-10*exp^(-0.50*x)','x');

4 years ago | 1

| accepted

Answered
Multi variable parameter estimation from data set
Ok. Form one big matrix M with the data of all your Excel sheets. First column: x Second column: I Third column: Ct corre...

4 years ago | 0

| accepted

Answered
What is the diffrence between sign(R) and sign(real(R)) function ,where R=r*exp(-j*angle(h))
For complex numbers z, sign(z) = z/abs(z) So in your case sign( R) = exp(-j*angle(h)) and sign(real( R)) = sign(r*cos(...

4 years ago | 0

Answered
How to solve this ODE45 error?
options=odeset('AbsTol', 1e-5, 'RelTol', 1e-8); sol2 = ode45(@sfun,[0, 100],[0.01 0.25 0 0 0 0 0 0]); t=sol2.x; p1=0.05*sol...

4 years ago | 1

Answered
Integral error in the function
func = @(t) t.^0.5.*exp(-t); Gamma = integral(func,0,Inf);

4 years ago | 0

Answered
Trouble with optimization of two variables based on data set
Try this code: Lq = Lq(:); Tq = Tq(:); n = numel(Lq); A = [ones(n,1),-Lq]; b = log10(Tq); sol_lin = A\b; sol0 = [exp(sol_...

4 years ago | 1

Answered
Finite Difference Centre Time Centre Space
Never ever use centered-in-space for the advection equation ! I commented out the settings for the centered-in-space scheme (nu...

4 years ago | 0

Answered
find radius of xyz data
It's an optimization problem: min: r^2 s.c. (x_i-x_s)^2 + (y_i-y_s)^2 + (z_i-z_s)^2 <= r^2 (i=1,...,number of points in 3d c...

4 years ago | 0

Answered
Finite difference method - Second order equation with special conditions
As your equation can be written as 1/r * d/dr (r*dT/dr) = 0 the usual discretization in r = r_i is 1/r_i * [(r_i + dr/2)*(T(r...

4 years ago | 0

Answered
3-D Bivariate Histogram
https://de.mathworks.com/matlabcentral/answers/259883-plot-histogram-for-multiple-cases-in-3-dimensions Is it this what you wan...

4 years ago | 0

| accepted

Answered
Brute force for finding optimal value
I don't understand. Your function has a single maximum at x=0.25+pi/2. Why are you talking about 10 x-values ? Do you perhaps m...

4 years ago | 0

Answered
Issues with undefined variables in curve fitting
data = readmatrix("RAW_Zener_Diode_I-V_Data.xlsx") ; vD = data(:,1); iD = data(:,2); zener_response = @(p,vD)(p(1).*(exp(p(3...

4 years ago | 0

Answered
Need help writing this equation in MATLAB
phi = rand(20,1); p = 2*prod(1-phi); psi = sum(phi.*(1-phi))/p;

4 years ago | 0

Answered
How to plot data on a curved surface.
You mean a=1; b=1; x=-a/2:0.01:a/2; y=-b/2:0.01:b/2; [X,Y] = meshgrid(x,y); F = cos(pi*X/1).*cos(pi*Y/1) surf(X,Y,F) ?

4 years ago | 0

Load more