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

5 years ago | 0

| accepted

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

5 years ago | 1

| accepted

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

5 years ago | 1

| accepted

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

5 years ago | 0

| accepted

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

5 years ago | 1

| accepted

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

5 years ago | 0

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

5 years ago | 0

| accepted

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

5 years ago | 1

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

5 years ago | 0

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

5 years ago | 0

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

5 years ago | 2

| accepted

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

5 years ago | 1

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

5 years ago | 0

| accepted

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

5 years ago | 0

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

5 years ago | 0

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

5 years ago | 1

| accepted

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

5 years ago | 0

| accepted

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

5 years ago | 0

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

5 years ago | 0

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

5 years ago | 0

| accepted

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

5 years ago | 1

| accepted

Answered
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

5 years ago | 0

| accepted

Answered
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

5 years ago | 0

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

5 years ago | 0

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

5 years ago | 0

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

5 years ago | 3

| accepted

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

5 years ago | 0

| accepted

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

5 years ago | 2

| accepted

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

5 years ago | 0

| accepted

Load more