Answered

I get this message(Attempted to access F(5); index out of bounds because numel(F)=4.) when I run the code below..

In fsode you try to use F(7) when calculating F(5), before you have calculated F(7)!

I get this message(Attempted to access F(5); index out of bounds because numel(F)=4.) when I run the code below..

In fsode you try to use F(7) when calculating F(5), before you have calculated F(7)!

7 months ago | 1

| accepted

Answered

Laser Rate Equation Modelling

Like this? (Look at lines 27, 28 and 38) %Script % Define model parameters temperature = 25; wavelength = 1.312e...

Laser Rate Equation Modelling

Like this? (Look at lines 27, 28 and 38) %Script % Define model parameters temperature = 25; wavelength = 1.312e...

7 months ago | 0

Answered

Determine the coordinates of the nodes forming the outermost circle

Here's an alternative way: nodes = importdata("nodes.mat"); figure plot3(nodes(:,1),nodes(:,2),nodes(:,3),'b.','Markersize',1...

Determine the coordinates of the nodes forming the outermost circle

Here's an alternative way: nodes = importdata("nodes.mat"); figure plot3(nodes(:,1),nodes(:,2),nodes(:,3),'b.','Markersize',1...

7 months ago | 0

Answered

Problem with fitting a loglog plot

polyfit doesn't like the log of zero. One option is to remove the first row of the data: data_exp_high = load("data_Q_1e-8.txt...

Problem with fitting a loglog plot

polyfit doesn't like the log of zero. One option is to remove the first row of the data: data_exp_high = load("data_Q_1e-8.txt...

7 months ago | 0

Answered

Index in position 2 exceeds array bounds (Index must not exceed 1) errors?

N0 is a 4x1 vector, but you call it with two indices in the for loop! Turn N(1,j) into N(1) and similarly for the other calls t...

Index in position 2 exceeds array bounds (Index must not exceed 1) errors?

N0 is a 4x1 vector, but you call it with two indices in the for loop! Turn N(1,j) into N(1) and similarly for the other calls t...

7 months ago | 0

| accepted

Answered

How do I solve this ODE system where there exists derivatives in both sides?

You can separate the terms as follows:

How do I solve this ODE system where there exists derivatives in both sides?

You can separate the terms as follows:

7 months ago | 0

Answered

why am i getting grey figure box can someone fix please

Making some assumptions about your function pendulumODE, I think the following is more like what you expect to see: % Constants...

why am i getting grey figure box can someone fix please

Making some assumptions about your function pendulumODE, I think the following is more like what you expect to see: % Constants...

7 months ago | 0

Answered

Algae growing, concentration curve problem

Increase nt to 10000 and it works just fine for T = 20000.

Algae growing, concentration curve problem

Increase nt to 10000 and it works just fine for T = 20000.

7 months ago | 0

Answered

Error ''Array indices must be positive integers or logical values.'' when putting interval of 0.01 in a for loop

More like this: k = 0:0.1:2; n = numel(k); for i = 1:n x(i) = k(i); y(i) = k(i)*k(i) + 3*k(i) - 4; end plot(x,y...

Error ''Array indices must be positive integers or logical values.'' when putting interval of 0.01 in a for loop

More like this: k = 0:0.1:2; n = numel(k); for i = 1:n x(i) = k(i); y(i) = k(i)*k(i) + 3*k(i) - 4; end plot(x,y...

7 months ago | 0

Answered

Trying to code from Polymath

Like this for example (I'll leave you to extract the numerical values): Wspan = [0 2]; % Integration range % Initial valu...

Trying to code from Polymath

Like this for example (I'll leave you to extract the numerical values): Wspan = [0 2]; % Integration range % Initial valu...

8 months ago | 0

Answered

Unable to solve differential equation with finite difference method

Should be more like this I think: b = 0.02; m = 80; L = 0.7; g = 9.81; J = m * L^2/3; a = 0; bet = 2; alpha = 0; beta = 3...

Unable to solve differential equation with finite difference method

Should be more like this I think: b = 0.02; m = 80; L = 0.7; g = 9.81; J = m * L^2/3; a = 0; bet = 2; alpha = 0; beta = 3...

8 months ago | 0

Answered

FDM using succsesive overrelaxation method,

For w1 and T1 you have w1(:,Nx1+1) = (((la*B1*dx1)/(dx2*A1))*(w2(:,2)-w2(:,1)))+w1(:,Nx1); %Continuity of shear stress ...

FDM using succsesive overrelaxation method,

For w1 and T1 you have w1(:,Nx1+1) = (((la*B1*dx1)/(dx2*A1))*(w2(:,2)-w2(:,1)))+w1(:,Nx1); %Continuity of shear stress ...

8 months ago | 0

Answered

Solving first order ODE with initial conditions and symbolic function

You can do it numerically as follows: % input parameters Tinf=70+273.15; Ti=20+273.15; d=15e-2; r=d/2; cdepth=10/1100; Tf...

Solving first order ODE with initial conditions and symbolic function

You can do it numerically as follows: % input parameters Tinf=70+273.15; Ti=20+273.15; d=15e-2; r=d/2; cdepth=10/1100; Tf...

9 months ago | 0

Answered

can someone help me to analyze this program? How does the flowchart look like?

Perhaps this will help: %radiasi benda hitam % constants h=6.626e-34; c=3e8; k=1.38066e-23; % range of values lambda ...

can someone help me to analyze this program? How does the flowchart look like?

Perhaps this will help: %radiasi benda hitam % constants h=6.626e-34; c=3e8; k=1.38066e-23; % range of values lambda ...

9 months ago | 0

Answered

Error using surf (line 71) Data dimensions must agree

More like this? for it=1:2 for jt=1:3 zt(it,jt)=it+(jt-1); end end [x,y] = meshgrid(1:3,1:2); figure; surf(x...

Error using surf (line 71) Data dimensions must agree

More like this? for it=1:2 for jt=1:3 zt(it,jt)=it+(jt-1); end end [x,y] = meshgrid(1:3,1:2); figure; surf(x...

9 months ago | 1

Answered

How to find Basins of attraction for the Halley method?

Don'tforget the dot multiply: f = @(z) z.^3 +1; df = @(z) 3*z.^2; ddf=@(z) 6*z; % its roots r1 = -1; r2 = 1/2 + 1i*...

How to find Basins of attraction for the Halley method?

Don'tforget the dot multiply: f = @(z) z.^3 +1; df = @(z) 3*z.^2; ddf=@(z) 6*z; % its roots r1 = -1; r2 = 1/2 + 1i*...

9 months ago | 0

| accepted

Answered

"Invalid use of operator." doesn't go even after trying various solutions :(

Why nor just use Matlab's inbuilt cart2pol function?

"Invalid use of operator." doesn't go even after trying various solutions :(

Why nor just use Matlab's inbuilt cart2pol function?

9 months ago | 0

Answered

Heat equation using Boundary condition

function statements of this form (i.e. functions eq1, initial and ba) need to go at the end of the script, not the start.

Heat equation using Boundary condition

function statements of this form (i.e. functions eq1, initial and ba) need to go at the end of the script, not the start.

10 months ago | 0

Answered

A for loop that will run until a specific mathematical value is found

You could try replacing the "for i = 2:10 " loop by something like nports = 1; while Q(i)<Qdesired nports = nports ...

A for loop that will run until a specific mathematical value is found

You could try replacing the "for i = 2:10 " loop by something like nports = 1; while Q(i)<Qdesired nports = nports ...

10 months ago | 0

| accepted

Answered

How do I use an "if" statement to determine the highest input value?

Try help if

How do I use an "if" statement to determine the highest input value?

Try help if

11 months ago | 0

Answered

How to plot all figures in only one plot?

Here's one simple way: x=-pi:0.1:pi; c=-6:5; figure hold on for i=1:length(c) y=c(i)*x.^(2)+4*x+2; plot(x,y) end...

How to plot all figures in only one plot?

Here's one simple way: x=-pi:0.1:pi; c=-6:5; figure hold on for i=1:length(c) y=c(i)*x.^(2)+4*x+2; plot(x,y) end...

12 months ago | 0

| accepted

Answered

Error in Hermite Polynomial

In line for j = 0:i-1 you have j starting at zero. Matlab's indices start at 1, so the following line should have X(j+1) not ...

Error in Hermite Polynomial

In line for j = 0:i-1 you have j starting at zero. Matlab's indices start at 1, so the following line should have X(j+1) not ...

12 months ago | 0

Answered

Matlab code not computing

The use of square brackets in the scatter function is not the only problem! Are you looking for something like this? p=-1; z=...

Matlab code not computing

The use of square brackets in the scatter function is not the only problem! Are you looking for something like this? p=-1; z=...

1 year ago | 0

| accepted

Answered

how to plot the path of circular beam oscillation welding?

Like this? A=1; f=50; vf=0.02; time = linspace(0,100,500); x0 = vf*time; theta = 2*pi*f*time; x=A*cos(theta)+x0; y=A*sin...

how to plot the path of circular beam oscillation welding?

Like this? A=1; f=50; vf=0.02; time = linspace(0,100,500); x0 = vf*time; theta = 2*pi*f*time; x=A*cos(theta)+x0; y=A*sin...

1 year ago | 0

Answered

how to change the direction of the airfoil

Change contourf(real(J),imag(J),imag(f),v2); %%%%% fill(real(zair),imag(zair),'k') to contourf(-real(J),imag(J),imag(f),v2);...

how to change the direction of the airfoil

Change contourf(real(J),imag(J),imag(f),v2); %%%%% fill(real(zair),imag(zair),'k') to contourf(-real(J),imag(J),imag(f),v2);...

1 year ago | 0

| accepted

Answered

How to use 5 function coupled each other using ODE45? it is possible?

Better like this: MM0 = [10, 0, 0, 0, 0]; tspan = [0 100]; [t, MM] = ode15s(@mymode, tspan,MM0); M1 = MM(:,1); M2 = MM(:...

How to use 5 function coupled each other using ODE45? it is possible?

Better like this: MM0 = [10, 0, 0, 0, 0]; tspan = [0 100]; [t, MM] = ode15s(@mymode, tspan,MM0); M1 = MM(:,1); M2 = MM(:...

1 year ago | 0

| accepted

Answered

convert a column matrix with many rows into multiple column of equal rows

Try the reshape function.

convert a column matrix with many rows into multiple column of equal rows

Try the reshape function.

1 year ago | 0

Answered

"Not enough Imput arguments" ERROR

You haven't included J as an input argument to function Feedback_Ven_STEP.

"Not enough Imput arguments" ERROR

You haven't included J as an input argument to function Feedback_Ven_STEP.

1 year ago | 0

| accepted

Answered

Using polyfit in two arrays to detrend data.

polyfit just returns the coefficients of the polynomial. You need to use them in polyval to calculate data values.

Using polyfit in two arrays to detrend data.

polyfit just returns the coefficients of the polynomial. You need to use them in polyval to calculate data values.

1 year ago | 2

Answered

Implicit solution using pdepe 1D advection diffusion reaction equation

I think you've overcomplicated the situation! Should be more like the following (which you should check very carefully, as I di...

Implicit solution using pdepe 1D advection diffusion reaction equation

I think you've overcomplicated the situation! Should be more like the following (which you should check very carefully, as I di...

1 year ago | 0