How do I create a 2d surface plot for a function of x and y?
조회 수: 4 (최근 30일)
이전 댓글 표시
This is what I tried
x=linspace(0,10)
y=linspace(0,10)
[xm,ym]=meshgrid(x,y)
fxy=sin(x).*cos(y)
surf(fxy)
but it gives me
Error using surf (line 71)
Z must be a matrix, not a scalar or vector.
Error in problem3 (line 5)
surf(fxy)
댓글 수: 0
답변 (1개)
Kelly Kearney
2020년 3월 3일
편집: Kelly Kearney
2020년 3월 3일
Change
fxy = sin(x).*cos(y)
to
fxy = sin(xm).*cos(ym)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!