how to make a patch using normal vector?
1 次查看(过去 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!
0 个评论
回答(1 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polygons 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!