Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to do it?

1 回表示 (過去 30 日間)
Gemalyn Apostol
Gemalyn Apostol 2016 年 10 月 25 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
How to plot thesurface f=(x1-3)2+(x2-3)2 and add the boundary surface g=10(x1+x2≥4)? Thanks

回答 (1 件)

xiexiezaijian
xiexiezaijian 2016 年 10 月 25 日
I see, if no boundary, it will be easy with the help of built-in functions:
1. [x,y] = meshgrid(input arguments)% get the mesh grid point
2. z = (x-3).^2 + (y-3).^2;%calculate the z value
3. surface(x,y,z);% plot the surface
4. shading interp% make the surface more pretty
I get quite confused about your boundary condition: g = 10(x1+x2≥4); maybe you should set z value at these points to NaN, and continue with surface(x,y,z); shading interp
z(points out the boundary) = nan;

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by