L=4;,B=0.5;,D=0.5;,x=-2:0.02:2;,z=-2:0.02:2;
[X,Z]=meshgrid(x,z);
y1=(B/2)*(1-(2*x/L).^2).*(1-(z/D).^2);,y2=(-B/2)*(1-(2*x/L).^2).*(1-(z/D).^2);
surfc(x,z,y1);
Error using surfc
The surface Z must contain more than one row or column.
surfc(x,z,y2);
I want this, but it is not work.

 採用された回答

Dyuman Joshi
Dyuman Joshi 2023 年 10 月 5 日

1 投票

You need to use X and Z instead of x and z for defining y1 and y2.
And you can define y2 = -y1.
L=4;B=0.5;D=0.5;x=-2:0.02:2;z=-2:0.02:2;
[X,Z]=meshgrid(x,z);
% v v
y1=(B/2)*(1-(2*X/L).^2).*(1-(Z/D).^2);
y2=-y1;
surfc(x,z,y1);
surfc(x,z,y2);

1 件のコメント

현웅
현웅 2023 年 10 月 5 日
👍👍

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLive Scripts and Functions についてさらに検索

製品

リリース

R2023a

タグ

質問済み:

2023 年 10 月 5 日

コメント済み:

2023 年 10 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by