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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 1

| accettato

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

quasi 6 anni fa | 1

| accettato

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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 1

| accettato

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 1

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 2

| accettato

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

quasi 6 anni fa | 1

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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 1

| accettato

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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 1

| accettato

Risposto
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

quasi 6 anni fa | 0

| accettato

Risposto
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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 0

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

quasi 6 anni fa | 3

| accettato

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

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 2

| accettato

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

quasi 6 anni fa | 0

| accettato

Carica altro