Respondida
how to change color for one point in the scatter plot
a=[1:10]'; b=[11:20]'; scatter(a,b,'o','filled'); hold on plot(a(5),b(5),'ro','MarkerFaceColor','r')

más de 5 años hace | 1

| aceptada

Respondida
help using ODE45
Your temp equation can be written as the following three equations dx2dt = k1*dx4dt + k2*dx6dt + k3 dx4dt = k4*dx2dt + k5*dx6d...

más de 5 años hace | 1

Respondida
ode45 For Three Functions
Well, this is how you could structure it all in one file % What will happen to the population of bees in 12 months? Months or y...

más de 5 años hace | 0

| aceptada

Respondida
Plotting multidimensional discrete Data
Presumably, for every combination of rpm and torque you are able to calculate an efficiency, so you should be able to use contou...

más de 5 años hace | 0

Respondida
Stop the iteration loop at desire Ea
Like so %cinitial = input('\nGive the initial value of c : '); % Inputs initial value of x cinitial = 1; iterations = 0; ...

más de 5 años hace | 0

Respondida
What is wrong with the code ?
Remove the i = i+1; that immediately follows the while ,,, instruction. otherwise, first time in to the loop you are trying ...

más de 5 años hace | 1

| aceptada

Respondida
Helix model with radius
This is what your (unmodified) code produces for me:

más de 5 años hace | 0

Respondida
i need use division methob
A little more like this perhaps (note the way the function, f, is defined): f = @(x) x.^3- 0.2*x.^2 - 0.2*x - 1.2; a0=1; b0...

más de 5 años hace | 0

| aceptada

Respondida
Plotting the derivative of a non symbolically defined function
You could just do it totally numerically: phi0 = 0; dphidt0 = 5; IC = [phi0 dphidt0]; tspan = 0:0.1:20; v = 1:10; phi = ze...

más de 5 años hace | 0

| aceptada

Respondida
MATLAB - Delay sine wave
Like this? N=250; Fs=20; Ts=1/Fs; t=(0:N-1)*Ts; A = 3; f = 1; signal = @(t) A*exp(-t).*sin(2*pi*f*t); x = signal(t);...

más de 5 años hace | 0

Respondida
How I can to realize this function
Use indexing: Parabula = @(n) n.^2; n = -2:6; y = Parabula(n); y(n<1 | n>5) = 0; stem(n,y) axis([-10 10 0 30])

más de 5 años hace | 0

Respondida
rolling a dice 1000 times
mod not modulo. functions must come last in a script. for n=1000:1003 [win,avg]=dice(n); disp(['No. of wins ',int2st...

más de 5 años hace | 0

Respondida
Finite Difference method solver
By differentiating c' again you can solve the resulting second order ode as follows c0 = 1; v0 = 0; IC = [c0 v0]; tspan ...

más de 5 años hace | 0

| aceptada

Respondida
erlang c coding, can someone fix this coding for me? i keep getting error and I don't know what's wrong. Thank you in advance
Change for k=0:N_C(i) sum = T_tr.^N_C(i)/factorial(N_C(i))++(1--(T_tr/N_C))+sum+T_tr.^k/factorial(k); ...

más de 5 años hace | 1

Respondida
how to fix error in line 10 of the codes
f = 1./(1+25*(x.^(2))); % Notice the dots: ./ and .^ for element by element division and raising to a power.

más de 5 años hace | 0

Respondida
Newton Raphson method - Symbolic function
You have a = vpa(subs(df,x,i)); b = vpa(subs(f,x,i)); k_New = k-a/b; % but this is k - diff(f)/f ...

más de 5 años hace | 0

| aceptada

Respondida
Intersection of a linear and a non linear equation with Newton Raphson method
Change linear = a*x+b; to linear = @(x) a*x+b; and plot(root, linear, '*'); text(root, linear, '\leftarro...

más de 5 años hace | 1

| aceptada

Respondida
Plotting diffusion eq.
Your x values are far too large! Try x = (0:0.01:1)*10^-7; %%%%%%%%%%%%%%%%%%% t = [100 200 300]; c = 10^(-6); D = 10^(-...

más de 5 años hace | 0

| aceptada

Respondida
undefined function or variable x
Like so (the function must come last in the script): % solution of second-order differential equation % the function diff2(x,y...

más de 5 años hace | 0

| aceptada

Respondida
How to do Differential Equation Solution and plotting in matlab ? Please Help
Like so b1 = 1; a1 = 1; %t = 0:0.1:5; tspan = [0 5]; % a pulse function % plot to y0 = 0; y10 = 0; IC = [y0 y10]; %...

más de 5 años hace | 0

| aceptada

Respondida
Evaluating a function at complex values
You need to make sure F is a function. For your particular function you don't need it to be symbolic: >> F =@(x) x^5-5*x^4-8*x...

más de 5 años hace | 0

Respondida
How can I write a code that works like MS Excel "Goal seak"?
What about fzero? Your code could be structured like p90 = ... % put initial guess here p9_1 = fzero(@(p) fn(p, XSteam), p90)...

más de 5 años hace | 1

| aceptada

Respondida
Can i trasform a complex double into euler representation
Can you use abs and angle? >> a = -14.6566171621163 + 0.495320247582976i; b = -0.459846284143683 + 0.100914051723435i; c = -6...

más de 5 años hace | 0

| aceptada

Respondida
Code Won't Finish running
Use ode15s instead of ode45. Also, you might as well set the timespan to be [0 0.1] as nothing much changes after that!

más de 5 años hace | 0

Respondida
Creating a loop that performs actions for each set of values linked to a unique (but random) ID
Does this help: %% Setup the Import Options and import the data opts = delimitedTextImportOptions("NumVariables", 9); % Spe...

más de 5 años hace | 1

Respondida
Solving a PDE using Method Of Lines
The crucial lines requiring changes are [t c] = ode15s(@TracerFlow,tspan,IC,[],Nz,CA0init,dz,Da,U,k) % Recalculation C(:,1) =...

más de 5 años hace | 3

| aceptada

Respondida
How to superimpose certain indices of matrices.
Here's one possible way (there are probably slicker ways!): K111 = K1(1:3,1:3); K112 = K1(1:3,4:6); K121 = K1(4:6,1:3); K122 ...

más de 5 años hace | 0

| aceptada

Respondida
Partial derivative can anybody help me to slove this ?
Presumably you know density and saturation pressure as a function of temperature, either as functions or as data tables. This m...

más de 5 años hace | 1

| aceptada

Respondida
BVP for system of 2 second order ODEs
Here is how you can express your second order equations as first order ones You should now be able to express your boundary c...

más de 5 años hace | 0

| aceptada

Respondida
It follows the END that terminates the definition of the function "NumIntF" error
Put xi = 0; xf = pi; % or whatever your desired start and end values are. f = NumIntf(xi,xf) in a script and run that - it ...

más de 5 años hace | 0

| aceptada

Cargar más