Respondida
Unrecognized function or variable 'trapizoidal'.
This works for me exactly as you have listed it! This is the output: Function for which integration have to do f(v)= @(v)...

más de 5 años hace | 0

| aceptada

Respondida
converting values from conditional to single equation
One possibility f = x(i)*(x(i)>=0) + 0.2*(exp(x(i)) - 1)*(x(i)<0);

más de 5 años hace | 1

| aceptada

Respondida
make the line with the graph
More like this vin=linspace(0.2,2.8); current = zeros(1,numel(vin)); for i = 1:numel(vin) v = vin(i); if v < 0.5 ...

más de 5 años hace | 1

| aceptada

Respondida
Can someone solve the error for if sign(df(i-1))~=sign(df(i+1)) % it is a maximum
You start the loop for i=1:nx-2 from 1; but then have if sign(df(i-1))...etc. which means that you are specifying df(0). T...

más de 5 años hace | 0

| aceptada

Respondida
dividing integrals using vpaintegral and syms
If f(r) = r and you are integrating wrt r (implied by your yG integral) then x = r and xG = 2/3 and yG = 1/3. If you are expec...

más de 5 años hace | 1

| aceptada

Respondida
I'm getting the error "Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-31." The function Tn1(:,i)=tridiagonal(b,a,c,d); where there error lies, Can someone help me with this.
You should probably define Tn=Tinf*ones(N,M); and then set Tn1(:,i)=tridiagonal(b,a,c,d)'; However, there are other problems...

más de 5 años hace | 0

Respondida
Accented characters with interpreter latex
Just use title('Intensità') That works!

más de 5 años hace | 0

Respondida
Unrecognized function or variable 'FalsePosition'.
It works just fine for me! (I copied it into a script, saved the script and then clicked the Run arrow).

más de 5 años hace | 0

| aceptada

Respondida
What is wrong in me code? anyone can tell me please
If you do the suggested substitution your function should become f = @(t) (1/3)./(1+t.^(4/3)); and the limits are a = 0; b =...

más de 5 años hace | 1

Respondida
How to plot graph of Simpson's rule and Trapezoidal rule between error and n?
If you use cumsum instead of just sum then you can plot tr and simp against x.

más de 5 años hace | 0

Respondida
How to integrate a function over whose integrand upper limit is defined as an array?
You could try the following eta_array = [0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.2 2.6 3 3.4 3.8 4.2 ... 4.6 5 5....

más de 5 años hace | 0

Respondida
Answer not correct when comparing to wolframalpha
Your WolframAlpha expression is a mixture of your Function_A and Function_M. You have used G_M, from Function_M, but in the de...

más de 5 años hace | 2

| aceptada

Respondida
Solving differential equations involving heaviside function.
Here's a snippet that works, but it would be better if you uploaded your code, as we stand a better chance of solving your probl...

más de 5 años hace | 1

Respondida
How to add a 'No Data' label on a Bar plot
Add something like the following at the end of your code text(10,102,'No Data','Rotation',90) text(11,102,'No Data','Rotation'...

más de 5 años hace | 0

| aceptada

Respondida
Sum of selected elements in Matrix
How about: for i=1:10, S(i) = sum(sum(A(1:i,1:i))); end where A is your 10x10 matrix and S contains the 10 sums.

más de 5 años hace | 0

Respondida
How to find the root value of h in a differential equation?
Try adding the line h = vpasolve(Df(h)==0,h)

más de 5 años hace | 0

Respondida
Summation of matrices using symsum or other
It's difficult to tell from what you've listed, but have you tried getting rid of all symbolic stuff and using just numerics (wh...

más de 5 años hace | 1

| aceptada

Respondida
Using for loop with ODE solver
Structurally, your code needs to look more like the following: T_span_MSK = linspace(460,860)'; % E_MSK = []; %matrix of aci...

más de 5 años hace | 0

| aceptada

Respondida
Not sure if i've writen this program properly
Your code looks ok, except that, since your gravity is in cm/sec^2, it should probably be slightly modified to radius = input('...

más de 5 años hace | 0

Respondida
Alternative Newton-Method using for-loop
This f = @(x) x^3-x^2-x+1; MaxIter = 100; TolX = 1e-2; x0 = -0.2; delta = 1*10^(-5); iter = zeros(MaxIter+1,1); %Pre-alloc...

más de 5 años hace | 0

Respondida
Alternative Newton-Method using for-loop
It works for me ok using the function f = x^3-x^2-x+1 and initial guess x0 = -2. However, replace if k == MaxIter fprintf('Th...

más de 5 años hace | 0

| aceptada

Respondida
write the program to calculate real roots of quadradic equation with nested function.
You are over complicating things! All you need is function[x1,x2]= quadratic(a,b,c) d = sqrt(b^2-4*a*c); ...

más de 5 años hace | 1

| aceptada

Respondida
3-D-plot doesn't look like on Wolfram Alpha
It looks the same to me as long as you enter plot sin(x)/(y^2+1) from x=-2 to 2 and y=-2 to 2 into Wolfram Alpha

más de 5 años hace | 0

| aceptada

Respondida
Trying to simplify code to see if 3 vectors are at right angle. Unsure of outcome.
The dot product is zero if the vectors are at right angles. help dot

más de 5 años hace | 0

Respondida
How to create Runge-Kutta 4th order method to solve second-order ODE's
A little more like this perhaps (note the MATLAB syntax): fx = @(v) v; fv = -9.8; tmax = 2; t0 = 0; n = 50; v0 = 10; h=(t...

más de 5 años hace | 0

Respondida
shewel function writing to find the global minimum with three variables
You probably want abs not mod. You don't define F1 or F2 anywhere within the function You have ouput not output in the last li...

más de 5 años hace | 0

Respondida
1D Advection-Diffusion
Perhaps this will help % Concentration Distribution of contaminant (C) T = 4000*24; % [hrs] total time D = (1E-6)*360...

más de 5 años hace | 3

| aceptada

Respondida
Antoine's equation - K values
Like this perhaps: s = [0.3; 0.5; 0.2]; P = 10; fi = 0.7; n = 3; A = [9.1058; 9.0580; 9.2131]; B = [1872.46; 2154.9; 24...

más de 5 años hace | 0

| aceptada

Respondida
Input a Vector as Function Argument
Either x = [2 , 4] y = sq(x(1),x(2)) function out = sq(a , b) out = a.^2 + b; end or x = [2 , 4] y = sq(x) func...

más de 5 años hace | 2

| aceptada

Respondida
Problem in generating iterations in 3/8 simpson rule
Not entirely clear to me between what limits you are integrating, nor what your loops are doing! Perhaps the following might hel...

más de 5 años hace | 0

| aceptada

Cargar más