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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 2

| aceptada

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

| aceptada

Respondida
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,:)

alrededor de 6 años hace | 0

Respondida
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;

alrededor de 6 años hace | 0

| aceptada

Respondida
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);

alrededor de 6 años hace | 1

| aceptada

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

alrededor de 6 años hace | 1

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

| aceptada

Respondida
Counting number of runs (excluding zeros)?
Try plus1 = sum(data>0) and neg1 = sum(data<0)

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

Respondida
if statement on vector to replace values
If M is the vector try: ix = (M<0); M(ix) = 0;

alrededor de 6 años hace | 1

| aceptada

Respondida
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

alrededor de 6 años hace | 0

Respondida
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;

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0