How to plot a triangular shape function on a triangular domain?

10 ビュー (過去 30 日間)
Soroush Asarzadeh
Soroush Asarzadeh 2016 年 4 月 25 日
コメント済み: Soroush Asarzadeh 2016 年 4 月 27 日
Hello, I want to plot the following shape function: N(s,t)=t*(2*t-1) It has to look like the following diagramm:
but I get this one:
Here is my code:
[s,t]=meshgrid(0:0.1:1,0:0.1:1)
N3=@(s,t)t.*(2*t-1);
surf(s,t,N3(s,t))
I know that the problem is with the rectangular domain, that meshgrid generates. But I don't know how to define a triangular domain. Has anybody an idea?
Thanks

採用された回答

Mike Garrity
Mike Garrity 2016 年 4 月 25 日
I described one approach in this thread.
  3 件のコメント
Soroush Asarzadeh
Soroush Asarzadeh 2016 年 4 月 27 日
Thank you very much Mike!

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

その他の回答 (0 件)

カテゴリ

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by