How to plot a surface in an easy way
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi guys! I have a function LSQDiff which takes a vector argument x that consists of two values x(1) and x(2) and returns a vector of differences.
I want to take a squared norm of this vector and plot it for different values of x(1) and different values x(2)
I have vector a for different values of x(1) and vector b for x(2);
How can I plot a surface with this?
댓글 수: 0
답변 (1개)
the cyclist
2013년 7월 7일
Here is a simple example of using the surf() command to plot a surface.
a = 1:10;
b = 1:7;
[aa,bb] = meshgrid(a,b);
z = aa + bb.^2;
surf(aa,bb,z)
댓글 수: 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!