Answered
making a 3d contour
pr = 0.734; n = 1.413e-5; ts = 12; l = 10; w = 4; k =0.02428; V = 10:2:50; To = 0:10; for iv = 1:numel(V) v = V...

3 years ago | 0

| accepted

Answered
Determine positions of projected points onto an ellipse
a = 2; b = 1; % main axes x0 = 1; y0 = 1; % translation alpha = 5; % rotation angle of ellips...

3 years ago | 1

Answered
Generate random numbers with constraints
https://de.mathworks.com/matlabcentral/fileexchange/9700-random-vectors-with-fixed-sum

3 years ago | 0

Answered
pdepe function doesnt stop compiling
You set par.rho*par.g*u(1)^2-par.k2*(par.gamma*(2*par.R1)^-1)*u(1)^(1/2)*dudx(1) = 0 at x=0. Are you sure this is correct ? p...

3 years ago | 0

| accepted

Answered
Solve a nonlinear equation with constrains
p0 = 1000e6; t0 = 1e-6; td = 1e-6; t = t0 + td; c = 7.5e8; a = @(r)log(r)./(t0*(r-1.0)); b = @(r)a(r).*r; func= @(r) ...

3 years ago | 1

| accepted

Answered
3 dimensional interpolation.
Make an interpolation function from your data and call "integral2" with this function as to be integrated within specified limit...

3 years ago | 0

Answered
Why receive Error using sub2ind (line 73) Out of range subscript. Error in sym/subsref?
I hope you know what you are doing ... M=1; a=[1,1,1,1]; b=[1]; h=1; WW = rand(10,10,4,M); W = zeros(10,10,4,M); W = sym(...

3 years ago | 0

| accepted

Answered
Fourier Series, how to properly call the function? it says my left and right sides have different number of elements.
You defined f piecewise in f and flim. With the commands an(n) = (1/T) * int(f*cos(2*n*pi*t/T), flim(1), flim(end)); ...

3 years ago | 0

Answered
sum in function of function itself (recursive)
Works for me: f = @(x)x^2; a = 0; b = 1; e = 1e-4; y = adaptive_quadratur(a,b,e,f) function y=adaptive_quadratur(a,b,e,f) ...

3 years ago | 0

| accepted

Answered
9x3 linear system (least squares)
https://de.mathworks.com/help/matlab/ref/lsqnonneg.html

3 years ago | 1

| accepted

Answered
i need monte carlo simulation of malaga distribution.
Fourth hit if you google your subject as Malaga distribution

3 years ago | 0

| accepted

Answered
Why I'm I getting this error when I try to call the function myfourier in another m file?
Give another name to the MATLAB function created here: fourier = matlabFunction(fs); There is already a MATLAB built-in functi...

3 years ago | 0

| accepted

Answered
Solving four trigonometric equations, four unknowns
It seems that only 4 complex solutions exist. syms phi2 phi3 phi4 r1 eqn1 = 10*cos(phi3)+10*cos(phi2)-r1 == 0; eqn2 = 15*cos...

3 years ago | 1

| accepted

Answered
I should do the same sing, but woth '' \ '' operator.
Extensive answer has been given here: https://de.mathworks.com/matlabcentral/answers/1875297-how-can-i-find-the-coeficients-alp...

3 years ago | 0

Answered
Why I'm I getting results in terms of t for an and bn even though it is an integration with specific limits?
syms t f = [pi+t,pi-t]; flim= [-pi,0,pi]; N = 5; T = flim(end)-flim(1); w0 = 2*pi/T; fs = 0.0; for i = 0:N for k= ...

3 years ago | 0

Answered
Optimization mvncdf and integral problem
There were some errors in the function supplied to compute the MND. Use function values = fy(x,y,z,det_Y_std,inv_Y_std,Y_mean)...

3 years ago | 0

| accepted

Answered
can someone help me to write the code ?
A_100_iteration = cell(51,50,1); Result_100_iteration = cell(51,50,1); B1_100_iteration = cell(51,50,1); B2_100_iteration = c...

3 years ago | 0

| accepted

Answered
Finding x-intercept in a 2d plot shown below, there are multiple loops I want to find all the values of X at Y=0...Please help..
If you have the x-y values as vectors available, you can use this code to determine the x-values where y=0: i = find(y(1:end-1)...

3 years ago | 1

Answered
Plotting Fourier series in MATLAB (50 partial sums)
n = 1:50; x = (-2*pi:0.01:2*pi).'; f = 1/8 + sum(((-1).^n - 1).*2./(pi^2.*n.^2).*cos(n.*x) + (-1).^(n+1)./(4*pi*n).*sin(n.*x),...

3 years ago | 0

Answered
Why is my code not working?
Run [fList, pList] = matlab.codetools.requiredFilesAndProducts('untitled8.m') pList.Name pList.Version pList.ProductNumber ...

3 years ago | 0

Answered
Assembling Global Stiffness Matrix
This is analogous to your 2x2 code. I don't know if it's the right way to code M. k1=rand(4); k2=rand(4); k3=rand(4); C = ...

3 years ago | 0

Answered
question regarding sum(m,3) command
It is summed over the third dimension of the matrix. A = zeros(2,2,2); A(:,:,1) = [1 2;3 4]; A(:,:,2) = [5 6;7 8]; sum(A,3) ...

3 years ago | 0

| accepted

Answered
Optimize a variable which is dependent on other variables
theta = 1:20; l = 5; obj = @(x) x(1); x0 = rand(1,numel(theta)+1); sol = fmincon(obj,x0,[],[],[],[],zeros(1,numel(theta)+1),...

3 years ago | 1

| accepted

Answered
Getting multiple outputs in one time
A = arrayfun(@(k)stiff(k),1:20,'UniformOutput',0) function out = stiff(k) out = k*[1 2 3;4 5 6]; end

3 years ago | 0

Answered
how can i use simulated annealing for calculating the regression coefficients?
It's not simulated annealing, but most probably much faster. M = [3979278.479 654200.79 35.38 -27.86 4196516.825 554782.87...

3 years ago | 0

Answered
pointwise multiplication of sparse matrix with full array
rand(2,2,2,2) generates a (2x2x2x2) array for B. You cannot multiply A with such a B elementwise because the array sizes don't m...

3 years ago | 0

| accepted

Answered
Generating random circles/ellipses inside circular domain
Maybe you could generate the circles/ellipses in a square domain with side length R (the radius of your circular shape) and fina...

3 years ago | 0

Answered
A positive root of an equation
Without further knowledge about the background of your question: Maybe by setting (r(M)(a+P(M))(K-d))/(bK) instead of M in your...

3 years ago | 0

| accepted

Answered
Convex quadratic problem on two variables
fminimax. min_d max_j (g_j^t*d + 0.5*d^t*B_j*d) And the solution variables have to be put in one vector x that can comprise as...

3 years ago | 0

| accepted

Answered
Finding roots of a two variable function
x = rand(10,1); fun = @(z)BirnbaumSaunders(z(1),z(2),x); z = fsolve(fun,[0.65,2.13]) norm(fun(z)) function f = BirnbaumSau...

3 years ago | 0

Load more