Beantwortet
How to add rows to the matrix
Like this ? A = [1 4 0 0 1 0 2 3 0 1 0 0 3 3 0 1 0 0 4 4 0 0 1 1 5 3 0 1 0 0 6 4 0 0 1 ...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to plot u(t) - u(t-2) on matlab
u = rand(20,1); du = u(3:end) - u(1:end-2); plot(du)

mehr als 3 Jahre vor | 0

Beantwortet
printing complete mathematical equation
I don't know exactly what you mean. syms M K X(t) %Physical Parameters dX = diff(X,t); L= M*dX^2/2+K*...

mehr als 3 Jahre vor | 0

Beantwortet
Precision and indices must be positive integers
ouputpoint(1) = 0 (see above). So you try to access P(0) which is not possible in MATLAB since array indices start at 1, not a...

mehr als 3 Jahre vor | 0

Beantwortet
printing complete mathematical equation
syms m(t) n(t) A(t) eqn = A==10*cos(m)+5*sin(n) deqn = diff(eqn,t)

mehr als 3 Jahre vor | 2

Beantwortet
How to solve and plot system of nonlinear differential equations?
d=0.015; xp1=0.002; xp2=d-xp1; tspan = [0 0.17]; y0 = [xp2 - 0.00000001;0;0]; options = odeset('RelTol',1e-12,'AbsTol',1e-1...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
i am not getting what is the problem with it
function good = find_good_hotels(hotels,ratings,cutoff) if ratings>=cutoff Ridx=find(ratings) good=hotels(Ridx) ...

mehr als 3 Jahre vor | 0

Beantwortet
plot issue 'input function must return single or double value. sym found.'
a = 0.2; %field loss coefficient α[db/km] alfa = a*log(20)/20; gamma = 1.3; % fiber non-linearity coefficient γ[1/w...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
9x3 linear (x,y,z must be positive)
A = rand(9,3); b = rand(9,1); sol = lsqnonneg(A,b) Now you can insert your data for A and b.

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to calculate double integral?
n = 1 ; t = 1; r = 1; s = 0:0.2:10; fun = @(x,z,k) x.^2.*exp(-2.*t.*x.^2)./(x.^2+1/r^2).^2 .* z.*exp(2*n*t.*z.^2).*besselj(0...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to fit data in an array to a multidimensional function?
Generate four 1d column vector X,Y,Z and F of your data where F(i) is the value of your function corresponding to F(X(i),Y(i),Z(...

mehr als 3 Jahre vor | 1

| akzeptiert

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 1

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 1

| akzeptiert

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
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)); ...

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 1

| akzeptiert

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 1

| akzeptiert

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 1

Beantwortet
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),...

mehr als 3 Jahre vor | 0

Mehr laden