closed contour complex integral

조회 수: 1 (최근 30일)
salah zetreni
salah zetreni 2015년 3월 13일
답변: Mike Hosea 2015년 3월 16일
hello.. please help me ∮(sinπz^2+cosπz^2)/((z-1)(z-2)) dz around z=2
answer this integral by using matlab ?
My attempt at the bottom but it was wrong .. please help me to detection the error ..thank u
fun=@(z)(sin(pi*z.^2)+cos(pi*z.^2))/((z-1)*(z-2));
>> g=@(theta)2*cos(theta)+1i*2*sin(theta);
>> gprime=@(theta)-2*sin(theta)+1i*2*cos(theta);
>> q1=quad(@(t) fun(g(t)).*gprime(t),0,2*pi)
??? Error using ==> mtimes
Inner matrix dimensions must agree.
  댓글 수: 1
salah zetreni
salah zetreni 2015년 3월 14일
what did he mean by mtimes???? plz help me

댓글을 달려면 로그인하십시오.

답변 (1개)

Mike Hosea
Mike Hosea 2015년 3월 16일
MTIMES is matrix multiplication. The functional notation is mtimes(A,B), but the operator notation for matrix multiplication is A*B. So A*B assumes A and B have consistent matrix dimensions, i.e. size(A,2) must be the same as size(B,1), unless either is a scalar. You used .^ instead of ^, which is good. That's presumably because you meant element-wise powers of array inputs, but you did not always use .* instead of *, nor did you always use ./ instead of /. Go back and fix all of those operators.
The QUAD function (which is obsolete, BTW--use INTEGRAL or QUADGK instead), makes evaluations of your function in "batches", so your function must accept an array and return an array. It is not enough that it works only when you pass in a scalar. In other words f([1,2]) must work and return the same result as [f(1),f(2)].

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by