Answered
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')

5 years ago | 1

| accepted

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

5 years ago | 1

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

5 years ago | 0

| accepted

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

5 years ago | 0

Answered
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; ...

5 years ago | 0

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

5 years ago | 1

| accepted

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

5 years ago | 0

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

5 years ago | 0

| accepted

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

5 years ago | 0

| accepted

Answered
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);...

5 years ago | 0

Answered
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])

5 years ago | 0

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

5 years ago | 0

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

5 years ago | 0

| accepted

Answered
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); ...

5 years ago | 1

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

5 years ago | 0

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

5 years ago | 0

| accepted

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

5 years ago | 1

| accepted

Answered
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^(-...

5 years ago | 0

| accepted

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

5 years ago | 0

| accepted

Answered
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]; %...

5 years ago | 0

| accepted

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

5 years ago | 0

Answered
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)...

5 years ago | 1

| accepted

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

5 years ago | 0

| accepted

Answered
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!

5 years ago | 0

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

5 years ago | 1

Answered
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) =...

5 years ago | 3

| accepted

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

5 years ago | 0

| accepted

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

5 years ago | 1

| accepted

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

5 years ago | 0

| accepted

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

5 years ago | 0

| accepted

Load more