Réponse apportée
Problem with simulating with SEIR variant
I get your results for I, Q and D. See them clearly by changing your Main section to; %SEIAQRD_Main to = 1; tf = 365; tspan...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
cycle for integrating vector sections
Perhaps you should have something like: for i=1:4:length(Fi)-2 x=Fi(i:i+2); % +2 I need to integrate sections (3 values ​​...

presque 6 ans il y a | 0

Réponse apportée
Find all possible unique combinations of weights of 3 assets
Here's a brute force and ignorance method: c = 0; n = []; for i=0:100 for j=0:100 for k=0:100 if...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
How to code an ODE System with paramters depending on variables
You can include the body of each "extra" function directly in the main function: function dYdt = System(t,Y) i_L = Y(1...

presque 6 ans il y a | 0

Réponse apportée
Conversion of a Fortran Equation to Matlab
This is the correponding MATLAB structure: for N = 1:TIMEF TCALC(N) = TEXP(1); for J = N:-1:1 ...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Branch Choice for Arguments of Complex Numbers in MATLAB
Can you use mod(angle, 2*pi) or mod(angle, -2*pi) as appropriate?

presque 6 ans il y a | 0

Réponse apportée
I want to write a code for Fano lineshape fit.
Create a function that calculates the sum of squared differences (SS) between your function and the measured values, and then us...

presque 6 ans il y a | 0

Réponse apportée
how to calculate the temperature of a thin rod using finite elements with the galerkin method? heat 1-d
I've attached a solution of the thin rod problem using the Galerkin FE approach. The attached is in Live Editor format so that...

presque 6 ans il y a | 0

Réponse apportée
How to collapse within a column vector
One possibility is: x = 1:12; for i = 1:length(x)/3 p = 3*(i-1)+1; y(i) = sum(x(p:p+2)); end

presque 6 ans il y a | 0

Réponse apportée
How to solve multiple DOF mass-spring linear system with attached resonators with ode45?
Something like this perhaps (but use your own data!): % Initial conditions u = zeros(length(tspan),length(x)); p = u; p(1,N/2...

presque 6 ans il y a | 0

Réponse apportée
how to discretize a nonlinear model using Matlab
This is a simultaneous, linear system. You could do something like the following (replacing my arbitrary data with your actual ...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
I need matlab code for optimization of the particle swarm (PSO)
Search pso on the Matlab File Exchange.

presque 6 ans il y a | 0

| A accepté

Réponse apportée
I am having a problem in doing assignment at Coursera
Your code has the limit 18 rather than 21. Given that, it produces the correct result. If you want the words true or false r...

presque 6 ans il y a | 0

Réponse apportée
draw a simple complex function
How about: x0 = 1; y0 = 2; z0 = x0 + y0*i; R = abs(z0); theta = 0:1/360:2*pi; x = x0 + R*cos(theta); y = y0 + R*sin(th...

presque 6 ans il y a | 0

Réponse apportée
Effect of Step Size ODE
Quite a few changes needed! F=@(t,y) 200*(y+0.01).^2*(0.2-y); %Initial Value Problem m = input ('Please choose the first m...

presque 6 ans il y a | 0

Réponse apportée
Euler's method to plot orbital trajectory of comet
It's the vpa function slowing everything. There is no need for it here. Try the following: % Euler's Method % Initial condit...

presque 6 ans il y a | 0

Réponse apportée
A problem with a "Recursive Function"
You could try the following: syms a b n=5; eqn=b==Recursive(n); a=solve(eqn,a); disp(a) function r=Recursive(m) ...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Generate manual repeatable signal for matlab
Like this? dt = 0.01; tf = 1.5; n = tf/dt + 1; for i = 1:n t(i) = (i-1)*dt; y(i) = wave(t(i)); end plot(t,y)...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Subplot in a for loop with different graphs
Something like this perhaps (though the labelling could be tidied up!): a = 0; b = 3; yt = @(t) 5.*exp(-t).*(-1 + sin(10.*t))...

presque 6 ans il y a | 0

Réponse apportée
fixed bed adsorption column model-solving PDE-freundlish isotherm
The following works. I can't say if the result is sensible or not - you will need to judge that. I'm not convinced that the co...

presque 6 ans il y a | 1

Réponse apportée
How to create bar plot with groups x-axis labels
Here's one way (there are almost certainly slicker ways!): % Arbitrary data x = 0:10:70; y = [ 5 2 3 7 8 1 7 4]; % Labels L...

presque 6 ans il y a | 7

| A accepté

Réponse apportée
Runge Kutta Loop and save array of results to workspace
Here's one way: p=1:0.2:5; h=0.15; x = 0:h:3; ...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Undefined unary operator '-' for input arguments of type 'string error
Why not just: y1 = [0,0,0,0,0,0,0,0,0,0,0,0.04,0.32,0.56,0.08,0,0,0,0,0,0,0,0,0,0]; y2 = [0,0.05,0.05,0.05,0,0.1,0,0,0.2,0.3,0...

presque 6 ans il y a | 0

Réponse apportée
Using RK4 to solve an equation of one variable only
The code you found is, in fact, for just one dependent variable (y). It is also updating the independent variable (t). Try the ...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
I would like to store store the change in temp in each node for each time step
I think the following does your desired calculations: %Parameters rho = 1; %density, kg/m^3 cp = 1; %specific heat, J/kgK K ...

presque 6 ans il y a | 0

Réponse apportée
What did I do wrong here?
I answered this here: https://uk.mathworks.com/matlabcentral/answers/559760-how-to-do-this-problem#answer_461267?s_tid=prof_co...

presque 6 ans il y a | 0

Réponse apportée
How to do this problem?
Try this: u0 = 5000; % This is the code that I wrote lambda = 0.03; pm = 9000; k = 100; f = @(t,p) lambda*p*(1-p./pm)-k; [...

presque 6 ans il y a | 0

Réponse apportée
How to make an if condition where strings are involved?
Try replacing letter~=alphabet with ~any(strcmp(alphabet,letter))

presque 6 ans il y a | 1

Réponse apportée
how to use reshape ?
If A is your 23043864x3 matrix, then B = reshape(A, 339, 203928); should work. Of course, you could simply use A where I've ...

presque 6 ans il y a | 0

Réponse apportée
How to solve y''+y'-2y=x
Something like this perhaps: Y0 = [2 5]; % intial conditions xspan = [0 5]; % x-boundary values % ode solver [x, Y] = ...

presque 6 ans il y a | 0

| A accepté

Charger plus