Community Profile

# Torsten

##### Last seen: Today
2,558 2013 年以降の合計貢献数

#### Torsten's バッジ

Unexpected output when trying to plot the solution to a system of nonlinear differential equations
Use hold on between the two plot commands.

| 採用済み

How do I make a function work with vectors?
tanH = (exp(x)-exp(-x))./(exp(x)+exp(-x))

1日 前 | 0

How can I put an integral inside a for loop when the bounds depend on the loop's variable?
Phi_ij1 =@(i,j) integral2(@(y,x) B_zi(i,x,y),0,y_min1(j),0,@(y)x_max1(y,j));

2日 前 | 1

L2 norm of the column
M_norm = normc(M)

2日 前 | 0

| 採用済み

Curve fitting toolbox - gaussian curve to histogram with no workspace data for the y - value
I think Matlab's "mle" is what you want instead of the curve fitting toolbox.

5日 前 | 0

lsqnonlin and stretched exponential function
error_bounds = nlparci(x,residual,'jacobian',J) after the call to lsqnonlin. If you don't have a toolbox with nlparci, search ...

6日 前 | 0

I'm getting an error related to fmincon
If you mean the eigenvalue largest in magnitude, this should give you a start. Incorporating fmincon can automatize the search ...

6日 前 | 0

root of nonlinear equation
ft = @( c ) 0.25* ... instead of ft = 0.25* ...

7日 前 | 0

| 採用済み

stop Ode45 when y is less than a value
As defined, ode45 expects myEvent to have 2 input parameters, but you use 3. Use Opt = odeset('Events',@(t,u)myEvent(t,u,minu)...

7日 前 | 0

| 採用済み

How to add the value of the 3 highest elements automatically from a vector?
[~,idx]=maxk(y,3); y(idx)=y(idx)+sx; y

7日 前 | 0

Extracting values that are greater than the threshold

7日 前 | 0

Fitting to an intergral
Use "ArrayValued=true" as option in the call to integral.

8日 前 | 1

| 採用済み

Hello guys, I need help.
[X1,X2,X3]=ndgrid(x1,x2,x3); Z=f(X1,X2,X3); %assumes f is vectorized M=[X1,X2,X3,Z]; [~,idx]=sort(M(:,4)); sortedM=M(idx,:...

8日 前 | 0

Temperature ramp then keep it at constant temperature
Copy the lines where you define the global parameters to the beginning of function "fun" and remove them in the upper part of th...

8日 前 | 0

Best way to solve my implicit equation
Use "fzero" or "fsolve".

8日 前 | 1

How can i implemente this PDE system?
Use "pdepe". You will need to specify four boundary conditions for this solver, although only two for the T equation were neces...

9日 前 | 0

| 採用済み

For Loop Which Skips Numbers Based on Row Vector
Use "setdiff" to remove the row vector elements from the range of the for-loop and name the vector v. Then simply type for v ...

9日 前 | 0

Euler function where you can define equation, starting x and y values, number of steps and the step length
Use g = f or g = @(x,y) f(x,y) instead of g = @(x,y) f.

9日 前 | 0

| 採用済み

Integrate for a specific period of time
t=0:.01:10; x = zeros(numel(t)); x(1) = 1; fun_xdot = @(t,x) -2*(x^3) + sin(0.5*t)*x; for i = 1:numel(t)-1 x(i+1) = x(i...

7ヶ月 前 | 0

| 採用済み

Why does fsolve seem not iterate towards the solution?
k = 0.1007; rZ = 12.6518; Rs = 0.164; Cmax = 7.0e-11; W = 1.704e8; iZ = 14.5273; Ls = 1.1e-7; a1 = (k/1000)^2*(rZ-Rs); ...

7ヶ月 前 | 0

| 採用済み

I am getting this error "Index in position 1 is invalid. Array indices must be positive integers or logical values." Kindly help me clear this.
i and j are not defined at this line of your code ; they are first introduced one line later.

7ヶ月 前 | 0

Finding Linear regression equation
x = [65 65 62 67 69 65 61 67]; y = [105 125 110 120 140 135 95 130]; X = [ones(numel(x),1),x.']; p = X\(y.'); b = p(1) m ...

7ヶ月 前 | 0

Non linear least squares for a system of equations
fun = @(z)[z(1)^0.5*Ydata+z(2)-X1data,... z(1)^0.1*Ydata+z(2)-X2data,... z(1)^0.15*Ydata+z(2)-X3data]; ...

7ヶ月 前 | 1

| 採用済み

How to iterate with fsolve to find Mach number
function main pt2pinf = [1.9, 2.7, 3.5, 4.3, 5.1, 5.9, 6.7, 7.5, 27.5, 47.5, 67.5 ,87.5 ,107.5,127.5, 147.5, 200, 252.5, 305,...

7ヶ月 前 | 0

| 採用済み

Setting of mass matrix
options = odeset('RelTol',1e-9,'AbsTol',1e-9*ones(608,1),'Mass', @(t,y)diag([ones(1,604) sin(t) 1 1 0])); or options = odeset(...

7ヶ月 前 | 2

How do I declare and iterate a variable in an ODE driver file?
yold = -Inf; Ssnh_in_1 = 1; [t,y]=ode15s(@(t,y)pha_cont(t,y,Ssnh_in_1),[0,15],y0); ynew = y(end,3); while yold < ynew Ssn...

7ヶ月 前 | 0

| 採用済み

Ode45 solves an equation that containing a definite integral term
function main a = ...; b = ...; c = ...; d = ...; u0 = 1; usol = fzero(@(u)fun(u,a,b,c,d),u0); fun_ode = @...

7ヶ月 前 | 1

Problem with jacobiSN function
I suggest you follow the steps suggested under https://de.mathworks.com/help/matlab/matlab_prog/calling-functions.html

7ヶ月 前 | 0

Weighted linear combination between vectors
weights = [0.25 0.25 0.25 0.25]; C = weights(1)*W(:,1) + weights(2)*W(:,2) + weights(3)*W(:,3) + weights(4)*W(:,4);

7ヶ月 前 | 1

Can you help me please !
function main tspan=[0 5]; y0=[0;100;0;10]; [t,y]=ode45(@khidonghoc,tspan,y0); plot(t,y(:,1),t,y(:,3)) hold on;gr...

7ヶ月 前 | 1

| 採用済み