Answered
It follows the END that terminates the definition of the function "NumIntF" error
Just change f=y(N+1); to f= y(end);

5 years ago | 0

Answered
Error: Assignment has more non-singleton rhs dimensions than non-singleton subscripts
In line beta(j,i)=(rho_air./rho_sea).*mp.*((u(1,1))./(Cf)).^2.*(1+cos(teta_i(j).*2)./2); you should have beta(j,i)=(rho_air....

5 years ago | 1

| accepted

Answered
Bouncing Ball Animation Getframe
Like this? g = 9.81; theta0 = 45*pi/180; v0=5; dt = 1/128; ntimes = 400; tend = ntimes*dt; t = linspace(0,tend,ntimes)...

5 years ago | 0

| accepted

Answered
For loop with three variables
1.You could have m as a function of, i, j and ii. Your loop then might look like for i=1:length(sigma) s = sigma(i); ...

5 years ago | 0

| accepted

Answered
Coupled set of odes
The structure could look something like this tspan = [0 tfinal]; IC = [x0 y0]; [t, xy] = ode45(@fn, tspan, IC); x = xy(:...

5 years ago | 0

Answered
How to determine the value of CONSTANT by solving the system of equation numerically. (A is need to determine)
Ok, I've now figured out how to obtain A (or alpha as it's known in the paper). It comes from the solution to the f ode. The mo...

5 years ago | 1

| accepted

Answered
contour plot of stream function for a tornado
More like this? m1=-3000; m2 = 5800;%strength R = 0:0.1:20; THETA = linspace(0,2*pi,numel(R)); [r,theta] = meshgrid(R,THET...

5 years ago | 0

| accepted

Answered
Find the intersection between two curves
Look at the fzero function (doc fzero). Express y1-y2 as a function and use fzero.

5 years ago | 1

Answered
equation system with time and space derivation
You could use the pdepe function (try doc pdepe). Alternatively, explicitly discretise z and use ode45 to solve the time depend...

5 years ago | 0

| accepted

Answered
how to stop executing while loop?
Use a condition inside the while loop, such as if x>10, break, end

5 years ago | 0

Answered
How to solve an ODE with 2 initial conditions and 2 unknown parameters and 3 boundary conditions (overdetermined?)
The following is as close as I can get. You might be able to do better by altering tolerances using setoptions, but I'll leave ...

5 years ago | 0

| accepted

Answered
Can anybody help me?
Change Pprime(i) = P.*(lambda) to Pprime(i) = P.*(lambda(i));

5 years ago | 0

Answered
Approximating /transforming /absolute error
For display purposes you can use fprintf: >> r=3;h=8;Dv=0.1; Dr=(Dv/3)*(1/(1/3*pi*h*2*r)); fprintf('%0.2g \n',Dr) 0.00066

5 years ago | 1

| accepted

Answered
Finding roots using Newton raphson method
Just get rid of the first line, you don't need it f=@(y) exp(y)-(sin(pi*y/3)); df=@(y) exp(y)-((pi*cos(pi*y/3))/3); x(1)=-3...

5 years ago | 1

| accepted

Answered
How to solve multivariable ODE
If you don't have the symbolic toolbox available you could just do something like the following % Define gradient function wher...

5 years ago | 0

Answered
How can I plot this second-order differential equation
More like this perhaps omega = 0.8:0.1:1.5; n = numel(omega); for i = 1:n dydt = @(t,y) [y(2); -0.2*y(2) + y(1) - y(1)...

5 years ago | 0

Answered
How can I use a string in legend()?
You could use Legend = ['HS+HG = 0.5+5' ;'HS+HG = 1+5']; legend(Legend) But make sure there are the same number of characte...

5 years ago | 1

Answered
Inverse hyperbolic fit to data
Here's an alternative, with V as the independent variable and P as the dependent one: % Data P = [5 7.5 10 12.5 15 17.5 20 25...

5 years ago | 2

Answered
make a function recursive (koch snowflake)
The following replaces the "for iteration = 1:n" loop with a recursive function %Koch draws Koch snowflake %n is how many iter...

5 years ago | 0

| accepted

Answered
What is wrong with my code?
Your code works if you put in sensible numbers for step size and velocity. Zero is not sensible!

5 years ago | 0

Answered
How can I solve it: Matrix dimensions must agree.
Replace if M ==[] with if isempty(M)

5 years ago | 0

| accepted

Answered
Getting a wrong answer using solve()
Running your code as is (I copied and pasted, with no changes), I get >> syms pa p1a; c=1.056; Eq1= -8 * p1a ^ 2 + (12 * c -...

5 years ago | 1

Answered
Best fit line on Semi log graph
Like so data=[0.891 35784.525582 0.91 39142.72 0.815 17679.26 0.891 25582 0.8861 30168.052]; ...

5 years ago | 1

| accepted

Answered
How to Plot a Fourier Series?
Here's the cosine version. You can add the sin version and play with different ranges for n: x = -24:0.1:24; n = 10; ycos = f...

5 years ago | 3

| accepted

Answered
How to plot an implicit and dicontinues function?
Do you mean like this (type doc contour for more detail): x1 = -2:0.01:2; x2 = -2:0.01:2; [x, y] = meshgrid(x1, x2); z = T...

5 years ago | 0

| accepted

Answered
Multiple roots formula with Matlab
I think your formula shoud be First define your function and its first two derivatives in Matlab f = @(x) x.^4- 6*x.^3 + 12*...

5 years ago | 0

| accepted

Answered
How to plot an implicit and dicontinues function?
Something like the following? (You could use surfc if you want contours as well): x1 = -10:10; x2 = -10:10; [x, y] = meshgr...

5 years ago | 0

Answered
plotting the graph, help me~~
You had a few mismatches between vgs and Vgs. Matlab is case sensitive. Try W=40; Vth=0.45; Leff=0.15; k=4.255*(10^-4)*(W/L...

5 years ago | 0

| accepted

Answered
Recursive Function in Matlab (Help)
The Newton_Raphson is a recurrence formula, not a recursive one, so what you have written is correct. Look at the last value o...

5 years ago | 0

| accepted

Answered
NUMERICAL INTEGRATION USING SIMPSONS
The problem is that you have many values of lambda. To deal with this use a loop to do the integration for each value of lambda...

5 years ago | 0

| accepted

Load more