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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 1

| akzeptiert

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

mehr als 5 Jahre vor | 1

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 1

| akzeptiert

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 1

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 2

| akzeptiert

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

mehr als 5 Jahre vor | 1

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 1

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 1

| akzeptiert

Beantwortet
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

mehr als 5 Jahre vor | 0

| akzeptiert

Beantwortet
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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 3

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 2

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

Mehr laden