Respondida
Matrix dimension must agree
w is size 1x501 not 1x500.

más de 5 años hace | 0

Respondida
Finding Solution of an equation with hyperbolic functions within an interval
First draw a graph of the function to see roughly where the roots are, then use fzero: f = @(x) 2*cos(403*x).*sinh(403*x) + 2*...

más de 5 años hace | 0

| aceptada

Respondida
How to plot bifurcation with Delay Differential equations?
How about the following for your loop (it assumed you have defined tau earlier in the file): for j=1:N+1 if t(j)<=tau ...

más de 5 años hace | 0

| aceptada

Respondida
How to use Find (or any other function) to create an Array
Here's another possible way r = repmat((1:9)',1,5); max(r.*S_dash)

más de 5 años hace | 1

Respondida
Euler's Method and Deflection of Cantilever Beam
Your derivative is incorrect for your specified deflection equation. I think your deflection equation is also not quite right....

más de 5 años hace | 0

| aceptada

Respondida
Runge Kutta 4 method to solve second order ODE
Your integration loop is mightily scrambled. It should be like this x(1) = x0; y(1) = y0; for i=1:length(t)-1 t(i+1) = i*...

más de 5 años hace | 0

Respondida
ode45 with matrix 1st order ode
Does this help z = -1; %parameter Needs to be negative or T1 blows up. n = 2; T0 = eye(n,n); xspan = [0 5*pi]; opts = odes...

más de 5 años hace | 0

| aceptada

Respondida
How can i solve for the maximum? (a little complex)
Here is a brute force and ignorance method! % Maximise Value = (9/7)*Na + (5/4)*Nb + Nc + Nd % Subject to 7*Na + 4*Nb + 3*Nc ...

más de 5 años hace | 0

Respondida
How to plot this?
How about ux = [1 0 -1 0 1]; uy = [0 1 0 -1 0]; % The order is CRU GPCC UDEL APH anticlockwise starting on positive x axis. ...

más de 5 años hace | 1

| aceptada

Respondida
Generate signals from trigonometric
More like this perhaps lambda= 1000; dz = 1; z = 0:dz:lambda; f = @(z) (z<lambda/2) - (z>lambda/2); n= 6; %[2 4 6 8 1...

más de 5 años hace | 0

Respondida
Runga Kutta Mthod 4
As before, your value for h is too large. Set h = 0.01 and it works!

más de 5 años hace | 0

| aceptada

Respondida
If statement with multiple conditions
Don't forget the indices: if Tp(Tp_Idx)==4 if 30<=r0(r0_Idx)<75 SSGF(Tp_Idx,r0_idx)=(7.84.*10.^(...

más de 5 años hace | 0

Respondida
How to solve simultaneously a system of ODEs containing both initial and boundary value problems
Your first two odes could be solved by ode15s, since they don't depend on y(3), then, having solved them, you could investigate ...

más de 5 años hace | 0

Respondida
ode; zero input response; drawing the function in matlab
I think you should interpret (D+1)^2y as D^2y + 2Dy + y; i.e. d^2y/dt^2 + 2dy/dt + y Currently you have it as (dy/dt)^2 +2dy/dt...

más de 5 años hace | 0

| aceptada

Respondida
Trying to do central difference method
You should probably use the following to calculate the gradient Grad = (f(1+h) - f(1-h))/(2*h); though a much smaller value fo...

más de 5 años hace | 0

Respondida
Dimension and line Error
It looks like you have some t's in your expression for Vy(i) that should be t(i).

más de 5 años hace | 0

| aceptada

Respondida
The function return value 'euler' might be unset. Es posible que el valor de retorno de la función 'euler' no esté establecido.
1 Probaby best to have f = euler(... rather than euler = f(... if you want to call the function euler. 2 You need to return yo...

más de 5 años hace | 0

Respondida
How to use ode45 to plot this code?
You have mixed up doing your own iterations with allowing ode45 to do its iterations! For ode45, just use the following N=1000;...

más de 5 años hace | 1

Respondida
Iterative method to find flowrate in pipe in series
Why would you assume the friction factor in the second pipe is the same as that in the first? You ony apply the head loss to th...

más de 5 años hace | 0

| aceptada

Respondida
Writing a differential equation for iteration using for loop.
This is known as simple Euler integration. It arises from % dx/dt = (a - x^2 - y^2)*x - omega*y % Let dx/dt be approximat...

más de 5 años hace | 1

| aceptada

Respondida
Solve a system of three coupled first-order differential equations
According to the pdf equations, instead of dxdt(3)=(1/(alpha*a))*(1/x(3)-(1+lambda*sin(2*x(2)))*x(3)); you should have dxd...

más de 5 años hace | 1

| aceptada

Respondida
Gaussian distribution in Matlab
Try something like >> M = 1; D = 1; % Set your own values c = @(t,x) M/sqrt(4*pi*D*t)*exp(-x.^2/(4*D*t)); x = -5:0.1:5; t...

más de 5 años hace | 0

Respondida
System of differential equation -empty sym
ode1=fiff(v)... should probably be ode1=diff(v)...

más de 5 años hace | 0

Respondida
Problem with a function
I don't have your daily log returns vector, so I can't check your result. You are the only person who can decide if the function...

más de 5 años hace | 0

| aceptada

Respondida
Problem with a function
Try changing n=lenght(x); to n=length(x); (Notice the spelling).

más de 5 años hace | 0

Respondida
rung kutta 4th order
Your integration loop isn't that of a fourth order RK routine. Presumably, -2 is standing in for -infinity here, so you correct...

más de 5 años hace | 0

| aceptada

Respondida
help using ODE45
The equations above are a little different from the ones in your initial code, but I've used them in the coding below m0=0.25 ;...

más de 5 años hace | 0

Respondida
Plotting multiple points in graph
Here is one way x = 1:10; y = 1:10; [x, y] = meshgrid(x,y); plot(x,y,'k.')

más de 5 años hace | 0

| aceptada

Respondida
Runge Kutta method for coupled oscillator system.
Do you mean like this %initializing x,y,t h=0.1; %step size t=0:h:50; x1 = zeros(1,numel(t)); y1 = x1; x2 = x1; y2 = x1; ...

más de 5 años hace | 0

| aceptada

Respondida
Numerical integration using Simpsons
I just get 11 values for I3, running your code!

más de 5 años hace | 0

| aceptada

Cargar más