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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 2

| akzeptiert

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 1

| akzeptiert

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

etwa 6 Jahre vor | 1

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 1

| akzeptiert

Beantwortet
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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0