Is this function write correct: -((exp(-x)*cos(y)+2*x)/(exp(-x)*sin(y)))
조회 수: 1 (최근 30일)
이전 댓글 표시
Is this function write correct: -((exp(-x)*cos(y)+2*x)/(exp(-x)*sin(y))) function is: -(e^(-x)*cos(y)+2x)/(e(-x)*sin(y))). Thanks
답변 (3개)
Martin MacKinnon
2017년 1월 5일
I'm guessing are you asking if the function on the left hand side is the MATLAB version of the function on the right hand side? If so, it appears to be correct - although the function on the right has one extra bracket.
Star Strider
2017년 1월 6일
It is, but it’s always best to vectorise it:
f = @(x,y) -((exp(-x).*cos(y)+2*x)./(exp(-x).*sin(y)));
Also, see the documentation for meshgrid (and ndgrid) as well), if you want to evaluate it most efficiently for a range of values for ‘x’ and ‘y’.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!