Answered
Solution of DAE-System is too linear
a = ...; b = ...; c = ...; k = ...; h = ...; f = ...; d = ...; m = ...; g = ...; e = ...; n = ...; odefun = @(t,x,y,z...

4 years ago | 0

Answered
Perform calculations on matrices stored in cells
help cell2mat

4 years ago | 0

Answered
Help with newton-raphson
f = inline('x.^2-3','x'); c0 = 2; n = 10; c = newtonRaphson(f,c0,n) function c = newtonRaphson(f,c0,n) df = @(x) (f(x+1...

4 years ago | 1

| accepted

Answered
How to create a separate function file for a piecewise function?
a = 3; b = 12; x = 0:0.01:12; plot(x,f(a,b,x)) function pw = f(a,b,x) pw = NaN(size(x)); idx = x>0 & x<b/a; jdx =...

4 years ago | 0

| accepted

Answered
I want to know x,y coordinate
f = @(t) [t.^3 + t , t.^2 + 2*t.^3]; f(0.5)

4 years ago | 0

Answered
Interp1 Function gives back NaN in second to last datapoint
Frames = [FE(33) FE(17) FE(1)]; 3Int = [x(33) x(17) x(1)]; instead of Frames = [FE(1) FE(17) FE(33)]; 3Int = [x(1) x(17) x(3...

4 years ago | 1

Answered
making pde matlab code
Setting m = 1 does not implement your equation in the image. Setting m = 1 would mean solving d(theta)/d(tau) = 1/eta * d/d...

4 years ago | 0

Answered
Different solutions of fmincon when changing x0
I wanted to ask if it is normal that fmincon can have different solutions with different x0? There can be several reasons for f...

4 years ago | 0

| accepted

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

Load more