Réponse apportée
Solution to Nonlinear Differential Equation
Here is some example code using arbitrary data: f0 = [0; 1; 2]; % initial conditions tspan = [0 2]; % integration limits ...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
I know that my equations are correct, but the error is telling me i need to use logical or positive values
You are trying to index Z1 with 0.01. i.e you are telling MATLAB to to create Z1(0.01). However, the argument to Z1 (and the o...

presque 6 ans il y a | 2

| A accepté

Réponse apportée
Help with differential equation Kolmogorov in queuing theory
Your code doesn't maintain condition (2) for all times. You should eliminate p6 from equations (1) using condition (2), then us...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Boundary conditions for different areas of phi
Firstly, phi is size 1x360, whereas f0 is of size 1x180, but, more importantly perhaps, phi>=0 & phi<10 means you want elements...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
problem in plotting in a nested while loop in a for loop
Replace the code after count = count+1; with the following to get separate figures (though the curves ae all the same!): fi...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
splitting a matrix into vectors
Like so: A = [1 2 3; 4 5 6; 7 8 9]; A1 = A(1,:), A2 = A(2,:), A3 = A(3,:)

presque 6 ans il y a | 0

Réponse apportée
How to make 2 matrix out of 1 one matrix??
If your first matrix is A, then: ix = find(A>0); B = A; B(ix) = 0; ix = find(A<0); C = A; C(ix) = 0;

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Extracting data from table hourly wise
Extract the temperatures values from the table as a column vector, then T = reshape(temperatures,24,31)'; Av = mean(T);

presque 6 ans il y a | 1

| A accepté

Réponse apportée
Changing elements of vector with matrix
One way as follows: a = 0 0 0 0 0 0 0 0 0 0 >> b b = 1 3 6 ...

presque 6 ans il y a | 1

Réponse apportée
integral of equation with known boundary
Sorry, i meant "integral". However, there were some other problems, but the code below works: Ep = 1.27; SDB = 0.19 ; Delta ...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
How can I translate the above psuedocode to
Possibly something like the following (though note that n would need to be 1 greater than the n in your original, because MATLAB...

presque 6 ans il y a | 0

Réponse apportée
Reduce computing time ode system
Look at the other triple loop. Similar improvements can be made: for y=1:length(hradialchamber) Aeffettiva_cell(y)=...

presque 6 ans il y a | 0

Réponse apportée
Reduce computing time ode system
Here's a start, looking at your triply nested y, k and i loops. % Remove expressions that don't depend on y, k or i from the ...

presque 6 ans il y a | 0

Réponse apportée
I have weibull parameters k = 2 and c = 10 m/s for wind speed, how to generate the frequency distribution of wind speed by applying Monte Carlo simulation with sample size N = 8000
How about: >> k = 2; c = 10; >> d = rand(8000,1); r = (log(1./(1-d))).^(1/k)*c; >> histogram(r)

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Counting number of runs (excluding zeros)?
Try plus1 = sum(data>0) and neg1 = sum(data<0)

presque 6 ans il y a | 0

Réponse apportée
Solution for an unknown variable
Something like this (obviously, I've used dummy data): % Initial guess alpha0 = 1; % Call function with fzero alpha = ...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Euler's Method
Here's a rather simpler way to do what you want: % EulerEpidemic.m % Data L = 25000; k = 0.00003; h = 0.2; y0 = 250; t...

presque 6 ans il y a | 0

Réponse apportée
How to calculate detivative of a function with respect to another function
Surely you don't need to do this in Matlab! Just set u = cos(x), so you have d/du(u^2 - 1) = 2u = 2cos(x)

environ 6 ans il y a | 0

Réponse apportée
Euler's method function problem.
How about the following (where I've left out most of your comment sections, but you can easily put them back): %DISEGNO LE SO...

environ 6 ans il y a | 0

Réponse apportée
Why legend something wrong
Instead of loglog(h, A,'k-'); % plot hold on; scatter(h,A,'k','*'); % simply use loglog(h, A, 'k*-'); % with t...

environ 6 ans il y a | 0

Réponse apportée
if statement on vector to replace values
If M is the vector try: ix = (M<0); M(ix) = 0;

environ 6 ans il y a | 1

| A accepté

Réponse apportée
create from a vector a vector of cumulative sums
cumsum does exactly that. For example: >> x = [1 3 5 7 9]; >> cumsum(x) ans = 1 4 9 16 25

environ 6 ans il y a | 0

Réponse apportée
How to add a vector to another vector in for loop
One way is to replace T_tot(j)=Tvec; by T_tot((j-1)*8760+i)=Tvec;

environ 6 ans il y a | 0

Réponse apportée
For loop goes longer than expected.
Try for i = 1:(stopSample-startSample+1) y5s_unfiltered(i,1) = y(i,1); % y is the source vector and y5s_unfiltered the de...

environ 6 ans il y a | 0

Réponse apportée
Kindly help me to solve this problem Thanks a lots!!! Non linear shooting method
You don't have multiplication signs between y' and cos and y' and sin: F = @(x,y,z) (y'cos(x)-y*log(y)); FY = @(x,y,z) (-y'si...

environ 6 ans il y a | 0