How do i find the function value for different values of xi &Yi; where f=function(x,y);i=1,2,..............n (n may be 15, 50 or 100)
조회 수: 1 (최근 30일)
이전 댓글 표시
How do i find the function value for different values of xi & Yi; where f= function(x,y); i=1,2,..............n (n may be 15, 50 or 100)?
댓글 수: 0
채택된 답변
Walter Roberson
2016년 1월 25일
If xi and Yi are both vectors of values, and you want to find the result at each pair of values xi(J), Yi(K), then
[XI, YI] = ndgrid(xi, Yi);
results = arrayfun(@f, XI, YI);
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!