Beantwortet
How to repeat a vector over and over?
a = rand(1,1023); a = repmat(a,1,ceil(50000/1023)); a = a(1:50000)

mehr als 3 Jahre vor | 1

Beantwortet
Plotting a summation with two variables
t = linspace(0,0.1,100); x = linspace(0,1,100).'; n = 1000; f = @(t) sum(6./(pi+6*(0:n)*pi).*sin(x.*(0:n)).*exp(-(pi/6+(0:n)*...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How can I perform a summation of a freqz function
syms z k F = @(a) symsum(z^(-k),k,0,a); F(2)

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
using lsqnonlin with constraints
% A=2*(c(1)+c(2))==u this is the constraint i want to use Then optimize with one parameter c(1) and insert c(2) = u/2 - c(1) f...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Finding the truncation error in an infinite sequence
How can I speed up the calculation by determining the dynamic level where error can be reduced to the barest minimum? You mean ...

mehr als 3 Jahre vor | 1

Beantwortet
Euler's Method with multiple step sizes
%%% Define the interval [a,b] and initial condition a = 0; b = 0.5; y0 = 1; %%% Find the approximated solution using Euler's...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How Do I Plot 24 equally distanced points (from 0<t<5, inclusive) that agree with an exact solution to an IVP? (RK4/Runge Katta Method)
Use scatter([t 5/24 10/24 15/24 20/24 25/24 30/24 35/24 40/24 45/24 50/24 55/24 60/24 65/24 70/24 75/24 80/24 85/24 90/24 95/24...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to solve multiple independent equations stored in one variable
for i = 1:numel(b) for j = 1:numel(M0) eq = x^2 - (tunnel.A(i)./Aster(j)*x).^2+2 == 0; tunnelM = solve(eq, x, "...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Matrix problem n*n
n = 3; A = reshape(1:n^2,n,n).'

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Not enough input arguments in lsqcurvefit function
x0 = 0 not x0 = [0 0] since k seems to be a scalar as you treat it in "calcor". Further I guess k= lsqcurvefit(@calcor,x0,...

mehr als 3 Jahre vor | 1

Beantwortet
optim.problemdef.OptimizationProblem/solve SOLVE requires a non-empty initial point structure to solve a nonlinear problem.
My advice is: Do what the error message tells you to do and supply an initial point structure to make MATLAB happy. initial.e =...

mehr als 3 Jahre vor | 0

Beantwortet
how to remove error form BVP4C code
The odes you want to solve cannot be defined in two separate ODE functions. If you want to solve two differential equations sim...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
fplot showing different curve to plot
plot(p_a,Q) instead of plot(Q,p_a): M = 100; p_b = 2; Q = @(p_a) M./(p_a + p_b); hold on fplot(Q, [0 35]) ylim([0 ...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Numerical solution to a larger equation.
What is the zero of your choice ? fun = @(lamda2)sinh(5.9605e-08*(((1.1259e+15*lamda2^2 + 7.5126e+15)^2)^(1/2) + 7.5126e+15)^(1...

mehr als 3 Jahre vor | 0

Beantwortet
What is wrong with my code, my equation is vdv/dy=-G*M/(y+R)^2 ?
syms G M R y v(y) Dv = diff(v,y); eqn = diff(v,y,2) == -G*M/(y+R)^2; cond = [v(0)==100,Dv(0)==0]; sol = dsolve(eqn,cond) Gn...

mehr als 3 Jahre vor | 0

Beantwortet
How to compare elements of two vectors in MATLAB ?
A = [1 2; 3 4]; B = [1 4; 3 5]; sum(A(:)~=B(:))

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Problem with time steps in Runge-Kutte method
vx(i+1) = vx(i) + (1/6)*(K1(2)+2*K2(2)+2*K3(2)+K4(2))*h; vy(i+1) = vy(i) + (1/6)*(K1(4)+2*K2(4)+2*K3(4)+K4(4)...

mehr als 3 Jahre vor | 1

Beantwortet
Travelling salesman problem - Dimension of arrays issue
To concatenate the three vectors, sqrt((Min_Dist(:,2)-SortedCoordinates(i,2)).^2+(Min_Dist(:,3)-SortedCoordinates(i,3)).^2) C...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to compute the double integral over dx and dy?
dx = 0.1; x = -0.5:dx:0.5; dy = 0.1; y = -0.5:dx:0.5; N = length(x); a = randn(N,N); b = randn(N,N); F = (a-b).^2; % Use...

mehr als 3 Jahre vor | 0

Beantwortet
find equilirium point with all parameter known
I don't know if this solves your problem, but of course you have to reverse the order of the commands here: if (hdot(4)<0) ...

mehr als 3 Jahre vor | 0

Beantwortet
Curve fitting the data series
The function you define as fitting function tends to Rdc + R1 + R2 + R3 + R4 + R5 as f tends to infinity very fast. In contrast...

mehr als 3 Jahre vor | 0

Beantwortet
Using fsolve for a set of complex equations
If you want to define K_step*X_step-F_step as a function handle, you will have to define all expressions involving components of...

mehr als 3 Jahre vor | 0

Beantwortet
how to find equlibrium point of 5 non linear system with numerical method
I don't know if the result is as expected. format long yequi = fsolve(@fun,rand(5,1)) fun(yequi) function dydt = fun(y) e...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Array indices must be positive integers or logical values.
H(0) does not exist in MATLAB. Array indices start with 1. And if inv(K-W^2*M) is a matrix, you cannot save it in a scalar H(W)...

mehr als 3 Jahre vor | 0

Beantwortet
Help with implicit functions in vector form
I have no clue why this happens since the two expressions are exactly the same. The reason is that [x y 1]*w' cannot be evaluat...

mehr als 3 Jahre vor | 0

Beantwortet
Please Help using fsolve (error)
f1 = (5+x1+x2)/(50-2*x1-x2)^2/(20-x1) - 4e-4; f2 = (5+x1+x2)/(50-2*x1-x2)/(10-x2) - 3.7e-2; f=[f1;f2] And it seems that you d...

mehr als 3 Jahre vor | 0

Beantwortet
Extra variable in differential equation's symbolic solution
ans1=dsolve(eqn2,'MaxDegree',3) gives the explicit (complicated) solution. For each t, root(...) means the root of the polynom...

mehr als 3 Jahre vor | 1

Beantwortet
Initial conditions for PDEPE
Maybe you could add a little diffusivity to the components with spurious oscillations (those with f=0). If this is not possible:...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
Goodness of fit for a Zipf distribution
I set up the maximum likelihood function for your data and came up with an estimated value of s = 2.116 for the distribution par...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
Problem solving simultaneous ODEs using 4th order Runge-Kutta method (Too many input arguments.)
I changed (1./(1+(1/B).*C22d)).*(-c1.*(K22.*vy)); to (1./(1+(1/B).*C22d)).*(-c1.*(K22d.*vy)); in the definition of fvy. And...

mehr als 3 Jahre vor | 0

Mehr laden