Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
頂点のみを指定して、台形などの MATLAB の図形をプロットするにはどうすればよいですか? 実線で結ばれた頂点が欲しい。台形で囲まれた面積も計算したいです。
どうやってやるの?
プロットには多くのオプションがあります。
plot、fill、patchはすべて可能性があります。
関数polyareaを使用して、一連の頂点で指定された領域を取得します。
fill(x,y,color) を使用
fill([1,2,3,4],[6,3,4,9],"red")
または最初の要素が最後に繰り返される plot(x,y):
plot([1,2,3,4,1],[6,3,4,9,6])
編集:地域のために
polyarea([1,2,3,4],[6,3,4,9])