Question

I am getting this error "Index in position 1 is invalid. Array indices must be positive integers or logical values." Kindly help me clear this.

CODE: Mt=0 m=0 for d=0.1:0.1:10.1 m=m+1 for i=a-2*(N-1)*wd-2*(N-1)*s:2*(wd+s):a-2*(N-N)*wd-2*(N-N)*s for j=a-2*(...

4 months ago | 1 answer | 0

Question

Integrand output size does not match the input size. Kindly help me clear the error.

CODE: %all variables are declared for ai=a-2*(N-1)*wd-2*(N-1)*s:2*(wd+s):a-2*(N-N)*wd-2*(N-N)*s for aj=a-2*(N-1)*wd-2*(N-1)*s...

4 months ago | 0 answers | 0

Question

XMIN must be a floating point scalar. Kindly help me in clearing the error.

CODE: %all variables are declared Mt1=0 for ai=a-2*(N-1)*wd-2*(N-1)*s:2*(wd+s):a-2*(N-N)*wd-2*(N-N)*s for aj=a-2*(N-1)*wd-2*...

4 months ago | 1 answer | 0

Question

XMAX must be a floating point scalar in double integral. Kindly help.

CODE: x=0 y=0 u0=4*pi*(10^-7); f=5*10^6; w=2*pi*f; u=4*pi*(10^-7); U=2; a=0.5 N=5 for d=0.1:0.1:1 s=0.001 N...

5 months ago | 1 answer | 0

Question

Z must be a matrix, not a scalar or vector error while using surf function.

'Mtotal' should be calculated for 'a' and 'wd' each with 5values. Means 'Mtotal' should be a 5X5 matrix. But the loops comes to ...

5 months ago | 1 answer | 0

Question

Undefined operator '*' for input arguments of type 'function_handle' error in Integral2. Kindly help me clear this error.

CODE: for d=0.1:0.1:1 A=0 r1=@(ai,aj) sqrt((x+ai).^2+(y+aj).^2+z.^2) r2=@(ai,aj) sqrt((ai-x).^2+(y+aj).^2+z...

5 months ago | 1 answer | 0

Question

Error "Integrand output size does not match the input size." in implementing double integration. Kindly guide me in eliminating the error.

CODE: a=0.15 d=sqrt(a.^2+a.^2) M=@(a1,a2)(((((-(sqrt(a1.^2+a2.^2+d)).*a1)-((sqrt(a1.^2+a2.^2+d)).*a2)-(a1.^2)-(a2.^2)).*((sqr...

6 months ago | 1 answer | 0

Question

ERROR: Undefined function 'sum' for input arguments of type 'cell'. Kindly help me resolve the error.

ERROR: Undefined function 'sum' for input arguments of type 'cell'. Error in PSCCandPSSCoptiWdVss (line 45) p=sum(arrayfun(@(...

9 months ago | 2 answers | 0

Question

Error executing triple intergration equation. I am getting 'Not a Number (NaN)' as output for the triple integration equation attached below (Image file). I have mentioned the code used also. Kindly help me in knowing where I am wrong.

CODE: syms x syms y syms phi N=10; u=4*pi*(10^-7) a=0.045; b=0.05; fun=@(x,y,phi) (cos(phi).*(x.*y))./(sqrt((x.^2)+(y.^2...

9 months ago | 0 answers | 0

Question

How to write code for double integration over closed surface D? I have attached the equation. Kindly help.

Please state the matlab function or code for this equation.

12 months ago | 0 answers | 0

Question

There is a error in my code. I have attached the equaion and my code. Kindly correct the part where i went wrong.

CODE: r1=sqrt((x+a1).^2+(y+a2).^2+(z.^2)) %a1,a2,x,y and z are defined r2=sqrt((a1-x).^2+(y+a2).^2+(z.^2)) r3=sqrt((a1-x...

12 months ago | 1 answer | 0

Question

Kindly check if my code for the attached equation is correct as the result obtained is incorrect. If I find that the code is correct, I'll recheck the values I defined.

The equation is attached below. CODE: syms x fun=(besselj(x,sqrt(a/b)).*besselj(x,sqrt(b/a)).*besselj(x,(gamma/sqrt(a*b)))...

12 months ago | 1 answer | 0

Question

I am getting error in integrating a function from 0 to infinity wrt x. Kindly help.

CODE: fun=@(x) (p*q*r*exp(-x*d/sqrt(a*b))); rx=integral(fun,0,Inf) Msq=pi*u*sqrt(a*b)*rx % where variables p, q, r, d, a and...

12 months ago | 2 answers | 0