Community Profile

photo

Torsten


Last seen: Today Active since 2013

Professional Interests:

Statistics

  • 36 Month Streak
  • Ace
  • Revival Level 2
  • Knowledgeable Level 5
  • First Answer

View badges

Content Feed

View by

Answered
Use lsqnonlin to optimize parameters to fit the property of a function
lsqnonlin slightly changes the input to "fun" from the first to the second call, but does not recognize any change of the output...

circa 5 ore ago | 0

Answered
lsqcurvefit requires all values returned by functions to be of data type double.
Setting y = e/f*sind(theta) makes no sense because this setup will have infinitely many solutions. Use a single parameter e ins...

circa 6 ore ago | 0

| accepted

Answered
Using Contourf to Create Contour Plot with XYZ Data
This will work, but I don't think the interpolation of the Z data fits your needs. x = [ 185 168 151 134 11...

circa 7 ore ago | 0

Answered
Inserting functions in a vector function
g = @(x) x.^2; f = @(x) x.^4; for i = 1:3 f = @(x) g(f(x)); v{i} = f; end x = 4; v{1}(x) v{2}(x) v{3}(x)

circa 14 ore ago | 0

| accepted

Answered
Relatively easy optimization problem in Excel it's hard to implement on Matlab
If you accept a MATLAB solution for this problem: min: norm(X*p-y) s.c. xt = data*w 0<=w<=1 w integer where p is (3x1) and...

circa 15 ore ago | 0

Answered
How to perform linear curve fitting based on distance from line instead of residuals
rng("default") t = rand(100,1); x = t/10 + randn(size(t))/10; y = 5*t + randn(size(t))/10; plot(x,y,'o') sol = fminsearch(@...

circa 15 ore ago | 0

Answered
Solution of two order differential equations; Fourth order Runge-Kutta method iteration
Running your problem with ODE45 gives your Runge-Kutta results. So the problem seems to be that your parameters are different fr...

circa 15 ore ago | 0

Answered
How to perform linear curve fitting based on distance from line instead of residuals
The residuals are the sum of the vertical distances of the points from the line. If you want to consider the orthogonal distanc...

1 giorno ago | 0

Answered
PERIMETER OF A 3D POLYGON WHICH DOES NOT LIE IN THE X-Y PLANE
The code should apply to your case: x = 3*cos(0:pi/20:2*pi); y = 3*sin(0:pi/20:2*pi); fn = cscvn([x;y]); % Compute enclosed ...

1 giorno ago | 1

| accepted

Answered
Initial Conditions not Generating on Graph
You plot "hs" for different values of "nd". So the initial condition for hs is always the same, namely 225 mm. I don't underst...

1 giorno ago | 0

| accepted

Answered
Nonlinear regression using lsqcurvefit
F = @(x,f) x(1)/2 * sin(x(2)*pi/2)./(cosh(x(2)*log(2*pi*f*x(3)))+cos(x(2)*pi/2)); instead of F = @(x,f)(x(1)./2)*(sin(x(2).*pi...

2 giorni ago | 0

| accepted

Answered
Problem with "if" command
Should be if PBtime_nb>PBtime_b instead of if PBtime_b>PBtime_nb;

2 giorni ago | 1

Answered
Minimize distance between curves
Differentiating with respect to a, setting the derivative to 0 and solving for "a" gives a = sum_i (f_i*g_i) / sum_i (f_i^2) I...

2 giorni ago | 0

| accepted

Answered
How to make 2D matrix from 3D matrix to solve 2D nonlinear system?
The matrix you have to create and work with is a (sparse) matrix of size (125000 x 125000). The 3d matrix above (whatever it ma...

3 giorni ago | 1

Answered
Use pdepe to solve an ode
So your equation is not a PDE, but a simple ODE. Either you try to artificially set du/dx = 0 at both ends and see whether the...

6 giorni ago | 0

Answered
Projected curve lengths (XY,XZ,YZ) of 3D arcs
Then just set the coordinate of the plane you project on to 0 and calculate the arc length of the resulting projected curve. An...

6 giorni ago | 0

| accepted

Answered
Solving a system of PDE using pdepe
The error is solved, but I think the boundary conditions at the right end can't be set within pdepe. The condition set at the m...

6 giorni ago | 1

| accepted

Answered
optimization toolbox with fmincon
If you want to admit x,y and z to be complex-valued, you also have to change your objective function to be real-valued for compl...

7 giorni ago | 0

Answered
How do I find the index of the first element equal to 0 for each row of a matrix in a fast way
[~,idx] = max(M==0,[],2) or idx = arrayfun(@(k)find(M(k,:)==0,1),1:size(M,1))

7 giorni ago | 0

Answered
Spline coordinates from spap2
x = -2:.2:2; y=-1:.25:1; [xx, yy] = ndgrid(x,y); z = exp(-(xx.^2+yy.^2)); sp = spap2({augknt([-2:2],3),2},[3 4],{x,y},z)...

7 giorni ago | 0

Answered
How can the lqr function in matlab be modified so that the 2*x'Nu term in the cost function J be replaced with a scalar value?
I wonder why the integral should be finite if you replace 2*x'*N*u by a fixed scalar value. This scalar value must definitely be...

7 giorni ago | 0

| accepted

Answered
solve quadratic equation with matrix input variable
syms P N =2000:-50:50; guess = 2; for i=1:numel(N) n = N(i); eqn=((((1.3+(((17.5).*P)./(P+n./20))).^2)+((0.036.*P)....

7 giorni ago | 0

| accepted

Answered
estimation of probability density function
help ksdensity

7 giorni ago | 0

Answered
Function value and YDATA sizes are not equal using lsqcurvefit
The integrator was not able to integrate your system of differential equations. So there was no or only an incomplete solution r...

7 giorni ago | 0

Answered
Solving system of 3 non-linear equation with dynamic equality output
syms x1 x2 x3 t A eqns = [ x1 == t*(10*abs((18*x2)/125 - (24*x1)/125 + 111/50)^2*sign((18*x2)/125 - (24*x1)/125 + 111/50) ...

8 giorni ago | 0

| accepted

Answered
Error in function interp1: Sample points must be unique.
You can use unique() to get rid of duplicate sample points. It will also sort them.

8 giorni ago | 0

Answered
Solving a System Consisting of PDEs & ODEs using Method of lines
What's wrong with the results ? The fact that Ca becomes negative ? L = 5; % length of reactor v = linspace(0,L,100).'; % di...

8 giorni ago | 0

| accepted

Answered
Error using integral; First input argument must be a function handle.
function z= continum(var,energy) z = integral(@(x)cont(var,x),2.39,inf); end

8 giorni ago | 0

Answered
Summing anonymous functions in a for loop: adding penalty terms for optimization
basefun returns a vector of size (8x1) . Now to each component of this vector you add the sum of the following scalar values la...

8 giorni ago | 0

| accepted

Answered
Does MATLAB have a feature to show step-by-step solution?
m = 5; B0 = 1; B = fsolve(@(B)fun(B,m),B0) fun(B,m) function res = fun(B,m) B sum1 = 0.0; sum2 = 0.0; for j=0:m-1 ...

9 giorni ago | 0

Load more