フィルターのクリア

how to make a patch using normal vector?

2 ビュー (過去 30 日間)
Sierra
Sierra 2022 年 5 月 28 日
回答済み: Ishu 2023 年 10 月 30 日
I made patch and connect them. so I could make a someting like a tube.
but the result(first image) is not what i intended to make.
I want to have a patch like a second image using normal vector.
let me know how to make a patch using normval vector.
thanks!

回答 (1 件)

Ishu
Ishu 2023 年 10 月 30 日
Hi Sierra,
I understand that you want to plot a patch over some already plotted graphs means you want to overlay a patch.
To plot a patch using a normal vector you can use "patch()" function. As you have not provided the data so I will not be able to plot your graph but a general example of the implementaion of "patch()" is show below.
x = [1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10];
y = [1, 4, 1, 2, 1, 8, 1, 5, 1, 3, 1, 9, 1, 7, 1, 6, 1, 10];
% Plot lines
plot(x, y);
x_patch = [1, 6, 6.5, 1];
y_patch = [1, 4, 9, 1];
% plot patch
patch( x_patch, y_patch, 'k', 'Facecolor', 'none');
xlabel('X');
ylabel('Y');
You can change the data according to your needs and can plot a patch as you want.
For more information of "patch()" function you can refer to the below documentaion:
Hope if helps.

カテゴリ

Help Center および File ExchangePolygons についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by