Réponse apportée
Can I get rid of this for loop with vectorization?
Try the following: G_max_chl = 20; % Maximal conductance of chloride G_max_glu = 30; % Maximal conductance o...

environ 5 ans il y a | 1

| A accepté

Réponse apportée
Write out the values of a vektor as corresponding variable name
Try help int2str

environ 5 ans il y a | 0

Réponse apportée
Help solving directional cosines
Don't the eigenvectors give you the principal axes? [V,D] = eig(A); Details: doc eig

environ 5 ans il y a | 0

Réponse apportée
Return only the positive values to be used in subsequent eqns
Why not use g = 32.3; v = sqrt(3*g/(2*cosd(45)*sind(45))); t = 2*v*sind(45)/g; which will give you positive values immediat...

environ 5 ans il y a | 0

Réponse apportée
fplot() for three functions
Try using limits, e.g. fplot(@(t) 16/3*exp(-2*t)-4/3*exp(-8*t), [0 20]); Also use t.*exp(...etc) not t*exp(...etc)

environ 5 ans il y a | 0

| A accepté

Réponse apportée
Unable to perform assignment because the left and right sides have a different number of elements.
You have some missing indices in calculating some of the k1 and k2's. You also need to set hold on to get all three methods on ...

environ 5 ans il y a | 0

| A accepté

Réponse apportée
Why wont my code stop running?
Not totally clear what you are trying to do! Are you integrating wrt x or t? The solution to dy/dx = -x/y is x^2 + y^2 = r^2 ...

environ 5 ans il y a | 0

Réponse apportée
performing iterations until equation becomes zero
Shouldn;t your first few lines here be: N = 0.1:0.1:5; for i=1:numel(N) No=(Ns+R*N(i))/(1+R); ...etc

environ 5 ans il y a | 0

| A accepté

Réponse apportée
Error in ODE45.
You have missed the m in your first global delaration. You should have global g CdS m rho uvw not global g CdS rho uvw

environ 5 ans il y a | 0

| A accepté

Réponse apportée
a multivariate quadratic function
Here's one way. It uses an initial guess for each element of P, q and r, then combined them into a single column vector which i...

environ 5 ans il y a | 0

| A accepté

Réponse apportée
Dubble sin in first order Differential Equation
Should be like this >> h = 0.01; begin = 0.0; finish = 5; % Don't use end here as that's a reserved word in MATLAB x = beg...

environ 5 ans il y a | 0

| A accepté

Réponse apportée
Random Walk Simulation for Multiple Particles
Do you mean like this: % Simulation of a random walk (delta = 1, tau = 1) rng('Shuffle') trials = ...

environ 5 ans il y a | 0

Réponse apportée
finding probability in Matlab
You could use a Monte-Carlo simulation approach. Building on your calculations we have, for example: % Monte_Carlo calculation...

environ 5 ans il y a | 0

| A accepté

Réponse apportée
Systems of equations (help me please)
You have four equations for 3 unknowns. You don't need eq3. It's immediately obvious from eq1 that l2 = 0; surely you don't n...

environ 5 ans il y a | 0

Réponse apportée
How to use iterations in solving system of equations? want to update the vector Y at each iteration but ending up with same Y defined in the beginning.
Try taking Y = (-eta.^2+1); outside the while command.. i.e. have Y = (-eta.^2+1); while change >1e-15 ...etc

environ 5 ans il y a | 0

| A accepté

Réponse apportée
Second order ODE - BVP
I used an alternative method that makes use of Matlab's fzero function. You can also see one way of avoiding the problem at x ...

environ 5 ans il y a | 1

| A accepté

Réponse apportée
Second order ODE - BVP
You start at xlow = 0, but your function bvp5ode has an x in the denominator. bvp4c doesn't like it when this is zero! If you ...

environ 5 ans il y a | 1

Réponse apportée
Including a periodic piecewise function of time in coupled ODE
Because eta is itself a function of x, you need to have dA = @(x,A)[-eta(x)*(maxBeta/2)*ks*ki*A(2)*A(3)*exp(-1i*delk*x) + ((k2...

environ 5 ans il y a | 0

| A accepté

Réponse apportée
How can I use values from datafile as a time dependent function in ODE system?
Use interp1 to interpolate values between data points. doc interp1

environ 5 ans il y a | 1

| A accepté

Réponse apportée
How to generate 8 random 2D coordinates that do not duplicate?
How about P = randperm(64); [I,J] = ind2sub([8,8],P); x = I(1:8); y = J(1:8);

environ 5 ans il y a | 1

Réponse apportée
Euler's Method
Since you are given velocity as a function of time, why don't you simply plug the desired values of time directly into the funct...

environ 5 ans il y a | 0

Réponse apportée
Help with ODE45
global g % The value of g must be specified before using it in the function via ode45 g = 9.81; options = odeset('AbsTol',...

environ 5 ans il y a | 0

| A accepté

Réponse apportée
How to solve first order ODEs to find four components (for velocity and displacement of projectile in X and Y directions)?
A little more like the following perhaps (it can all be done in one file): %Primary Conditions tspan=[0:0.5:4.5]; %Period...

environ 5 ans il y a | 1

| A accepté

Réponse apportée
Trouble finding solution of unknown variable in difficult integration problem
I used a different approach - see below. I could only see an increase in h, with increasing s, as a step change around s = 4.5....

environ 5 ans il y a | 0

| A accepté

Réponse apportée
differential equations of the type Q(t,h(t) where h(t) is based on volume
Does this help: g = 9.81; % m/s^2 c1 = 0.82; c2 = 1; Hspill = 3; % m Lw = 3; % m ...

environ 5 ans il y a | 0

| A accepté

Réponse apportée
How to plot a trigonometric function and a linear functions on the same graph to work out solutions to trigonometric equations?
Try plot(t,y1,t,y2*ones(size(t))) for example.

environ 5 ans il y a | 2

| A accepté

Réponse apportée
matching matrices that correspond to each other in a graph
Do you mean something like this (I'll leave you to play with the colours): correspond = [0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 ...

environ 5 ans il y a | 0

| A accepté

Réponse apportée
How can I implement recurrence relations to find polynomials?
Do you mean something along these lines: order = 4; a = [0, 0, 1.3, 1.4, 1.5]; % Obviously, replace with your own values. ...

environ 5 ans il y a | 0

| A accepté

Réponse apportée
Running the code takes too long to finish(Euler's Method)
Remove syms dh(t,h) and replace dh(t,h)=(K1+K2*sin(5*C*t)*cos(C*t)-rho*A_pipe*(2*g*h)^(1/2))/(rho*A_tank); with dh = @(t,h...

environ 5 ans il y a | 1

| A accepté

Réponse apportée
How to change the font of a pie chart?
You can do it from the Property Inspector after the program has finished.

environ 5 ans il y a | 1

Charger plus