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

mehr als 5 Jahre vor | 1

| akzeptiert

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

mehr als 5 Jahre vor | 1

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 1

| akzeptiert

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 1

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 1

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 1

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 1

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

mehr als 5 Jahre vor | 3

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 1

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

Mehr laden