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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 1

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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 1

| accettato

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 0

| accettato

Risposto
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.^(...

quasi 6 anni fa | 0

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 1

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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 1

| accettato

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

quasi 6 anni fa | 1

| accettato

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 0

| accettato

Carica altro