Answered
Problem of Symbolic function evaluation
u = sym('u',[2 1]); f = u.'*u result = subs(f,u,[1;2])

4 years ago | 0

| accepted

Answered
Why do I keep getting "no solution found" message?
Maybe a better code structure to debug the values "fsolve" gets from "sigmagap". You think that you know that "sigmagap" return...

4 years ago | 0

Answered
How can one calculate Differentiation of matrix array with time as first column and data as second column ?
B = [A(:,1),gradient(A(:,2))./gradient(A(:,1)); plot(B(:,1),B(:,2))

4 years ago | 0

Answered
How to select rows from an array?
B = [A(2,:);A(4,:);A(6,:)] or if you want the rows one by one: A2 = A(2,:); A4 = A(4,:); A6 = A(6,:);

4 years ago | 0

Answered
I get an error when I try to run my logistic regression.
theta is not initialized - thus the theta(i) at the right-hand side of the assignment theta(i) = theta(i) - (alpha/m) * sum(er...

4 years ago | 0

Answered
Curve fitting equation does not give the input z back
@Olaf Schipper Did you read that you have to use the normalized values for pA and T to evaluate mu(pA,T) ? f(x,y) = p00 + p10*...

4 years ago | 1

| accepted

Answered
calculate coefficients with linear regression
A = [ones(numel(xj),1),xj,xj.^2,exp(xj)]; b = yj; sol = A\b; a0 = sol(1) a1 = sol(2) a2 = sol(3) a3 = sol(4) where xj and...

4 years ago | 0

| accepted

Answered
How to set a RAM limit, so that if it gets passed, the simulation gets killed?
https://de.mathworks.com/matlabcentral/answers/34923-limiting-matlab-memory-usage

4 years ago | 0

Answered
L’Hospital’s rule
syms x a=x+2; b=x^2+3*x+2; c=a/b; limit(c,-2)

4 years ago | 1

| accepted

Answered
i want to solve a 297 linear equations with 298 unknown variables
My guess is that your equations are linear in the unknowns. If this is the case, try https://de.mathworks.com/help/symbolic/sym...

4 years ago | 0

Answered
Finding the sum to n of 1/2^n
format long n = 1:20; b = 1./2.^n; Sn = sum(b)

4 years ago | 0

Answered
Euler method with tabular inputs and multiple ODE's
The best way to refer to time-dependent data vectors in integration problems is to use "interp1". In your case above, e.g., de...

4 years ago | 1

Answered
How to use ODE4 to solve second order ODE
ode4 works with 1st order systems of ODEs. Yours is a 2nd order equation. Can you write your equation as a system of two first...

4 years ago | 0

Answered
Find maximum of quadratically constrained quadratic problem using MATLAB
Is this the simplified version of the problem you are trying to solve ? It seems fmincon gives the correct solution. N = 4; h...

4 years ago | 0

| accepted

Answered
Reference for the optimizePath function?
https://de.mathworks.com/help/pdf_doc/nav/index.html

4 years ago | 0

| accepted

Answered
Reference for the optimizePath function?
https://de.mathworks.com/help/pdf_doc/nav/index.html

4 years ago | 0

Answered
how to solve logarithm equation
log10(4*x)-log10(3*x) = log10((4*x)/(3*x)) = log10(4/3) log10(5*x)-log10(2*x) = log10((5*x)/(2*x)) = log10(5/2) So you try to ...

4 years ago | 0

Answered
Unrecognized function or variable 'ode4'.
Look below at how k_1,...,k_4 must be computed in the case that your ODE function only depends on t, not y. The classical Runge...

4 years ago | 1

Answered
Can I use mvncdf for Y=P[V(1)<XU(1), XL(2)<=V(2)<=XU(2)]?
You set XL(i) = -Inf. What's the problem ? xl(1) = -Inf; xu(1) = 0; xl(2) = -5; xu(2) = -2; mu = [0 0]; sigma = [1 0;0 1...

4 years ago | 0

Answered
Faster implementation of laguerreL
Maybe len = 1:100; [I,J] = meshgrid(len,len); output = laguerreL(I,J,2)

4 years ago | 1

Answered
Matrix column selection based on vector with indices
k=ones(6,4); v=randi(size(k,2),1,size(k,1)); v(end) = 0 idx = find(v>0) k(sub2ind(size(k),idx,v(idx))) = 0

4 years ago | 0

| accepted

Answered
finding a function with 4 variables
I suggest you start with height = a + b * sugar + c * yeast + d * flour If height,sugar, yeast and flour are column vectors of...

4 years ago | 1

| accepted

Answered
compact way to calculate euclidean distance among points
% x_a, y_a a = [0,0]; % x_b, y_b b = [0,1; 2,1; 1,1; 1,3]; D = pdist2(a,b)

4 years ago | 0

| accepted

Answered
For loop skipping with if statement
The usual average would be pk(a,2) = ( pk(a-1,2)*(pk(a,1)-pk(a-1,1)) + pk(a+1,2)*(pk(a+1,1)-pk(a,1)) )/(pk(a+1,1)-pk(a-1,1)) ...

4 years ago | 0

Answered
Anyone know how to solve 2*x^2+2*y^2=5, x*y=1 without using command syms?
x = roots([2 0 -5 0 2]) y = 1./x res1 = 2*x.^2+2*y.^2-5 res2 = x.*y-1

4 years ago | 1

| accepted

Answered
May I ask what MATLAB code for expected value is by fitting a Poisson distribution?
A = 1:100; lambdahat = poissfit(A)

4 years ago | 0

| accepted

Answered
Linear Fitting starting from a value
Sure. Use l(x) = a*x + 100 as model function and fit the parameter a. xdata = ...; % your xdata as column vector ydata = ...

4 years ago | 0

| accepted

Answered
how to fill a matrix without using loop in matlab?
If you want to plot the partial sums of the Fourier series, you will have to keep the last loop, I guess. close all; clear; clc...

4 years ago | 0

Answered
How to plot the variations for integrating parameter
Note that integral(H2Ox, 183000, Inf) = Inf !! H2Ox = @(EA) -0.0023*(-8/(48000^8))*(EA-183000).^7; H2Oz = @(y) integral(H2Ox, ...

4 years ago | 0

| accepted

Answered
Solve the complex equations
syms x real syms y real a=2*(x+y*j)==6-3j; sol = solve(a,[x,y]); sol.x sol.y

4 years ago | 0

| accepted

Load more