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...

3 years ago | 0

| accepted

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

3 years ago | 0

| accepted

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

3 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 ...

3 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...

3 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...

3 years ago | 0

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

3 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

3 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...

3 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)

3 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)) ...

3 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

3 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)

3 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 = ...

3 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...

3 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, ...

3 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

3 years ago | 0

| accepted

Answered
I would like to make surface plot of my probability of failure curve?
clear all; mue=0.82; %mean of unbiased factor of study case sige=0.189; %SD of unb...

3 years ago | 0

| accepted

Answered
How can I put a loop here?
V = [0.5 1 2 3 4 6 10].'; del = 0:1:90; del_r = del.*pi./180; x = V.*tan(del_r); del_r2 = atan(x); del2 = del_r2*180./pi;...

3 years ago | 0

| accepted

Answered
WATERMODEL returns a vector of length 825, but the length of initial conditions vector is 3. The vector returned by WATERMODEL and the initial conditions vector must have the
% Load file with variables temperature, ET etc, %% data=readtable("https://de.mathworks.com/matlabcentral/answers/uploaded_fil...

3 years ago | 0

| accepted

Answered
can any one tell me why this error has occurred.
i is a vector (at least when the loop index LL is 2, for LL = 1 i is taken as the imaginary unit because it's not yet defined), ...

3 years ago | 0

| accepted

Answered
How can I use fzero on these two functions?
Use the original equation. Why do you take log on both sides - it only implies problems for x <= 3/4. f = @(x)4*x-3-exp(-0.1*x)...

3 years ago | 0

Answered
how do i get the the fifth and fourth number form behind?
x = [2361273621, 2937812378, 2367823827]; b = arrayfun(@(a)num2str(a),x,'uni',0); b = arrayfun(@(i)b{i}(end-4:end-3),1:length(...

3 years ago | 0

Answered
Plotting using MATLAB problem
https://www.youtube.com/watch?v=GrpDgOjR5ZA

3 years ago | 0

Answered
How can i put a stopping criterion for this bisection method code in matlab?
f_x= @(x)sin(5*x)+cos(2*x); p_old = 0; % give an initial value to it x_l =2; x_u = 10; x=x_l:0.01:x_u; hold on plot(x,f...

3 years ago | 0

Answered
Is there any mathematical method of curve fitting for cases when the modeling function is unknown (another degree of freedom for the form of the function)?
No, there is no such method. Often, physical considerations are a way to decide for a suitable model function. If this is not ...

3 years ago | 0

Answered
How to generate a random number that is either 100, 200, or 300.
Hint: 100*1 = 100 100*2 = 200 100*3 = 300

3 years ago | 0

Answered
writing the equation of normalize correlation
rng('default') x = 4; y = 5; w = rand(x,y); wstroke = rand(x,y); NC = sum(w.*wstroke,'all')/sum(w.^2,'all')

3 years ago | 0

| accepted

Answered
Nonlinear optimization not working
fun = @(x,y,z) 25*x + 37*y + 48*z; x0 = [0,0,0]; A = [0 -1 2]; b = [0]; Aeq = []; beq = []; lb = [200 200 200]; ub = [...

3 years ago | 0

| accepted

Answered
Getting NaN greater values in a function
warning('off') iterations = [10, 100, 1000]; count = 1; p = 0.5; for n = iterations figure(); hold on; for ...

3 years ago | 0

| accepted

Load more