how can i create a surf (y=0) by surf and linspace functions?

2 ビュー (過去 30 日間)
Moein
Moein 2014 年 10 月 3 日
コメント済み: Stephen23 2014 年 10 月 3 日
hi friends
i want to create a surf y=0 in a domain by surf and linspace functions with this code:
hsp = surf(linspace(-0.3,1.3,200),zeros(200)+0.125,linspace(-0.251776695,0.501776695,200));
but it errors.
for the case z=0 the following code is correct:
hsp = surf(linspace(-0.3,1.3,200),linspace(-0.251776695,0.501776695,200),zeros(200)+0.125);
but for y=0 it errors:
Z must be a matrix, not a scalar or vector.
help me if you can.
thanks a lot
  1 件のコメント
John D'Errico
John D'Errico 2014 年 10 月 3 日
Please don't just keep on asking the same question repeatedly.

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

採用された回答

Stephen23
Stephen23 2014 年 10 月 3 日
編集済み: Stephen23 2014 年 10 月 3 日
All of the syntax examples given for surf plot Z as function of X and Y, even if only implicitly by supplying a matrix of Z values.
As an alternative, consider using the lower-level function surface , which allows for parametric surfaces.
  2 件のコメント
Moein
Moein 2014 年 10 月 3 日
thank you stephen
but i'm new to matlab.
can you write the code similar my code by using surface functon?
because i used surface in the code but it errors yet.
Stephen23
Stephen23 2014 年 10 月 3 日
If the surf works correctly (with Z as a function of X and Y), why not just use this standard functionality and rotate the surface inside the plot?

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by