2D triangle.

8 次查看(过去 30 天)
george samaras
george samaras 2016-11-7
回答: KSSV 2016-11-7
how to create a 2D triangle and save it as png or something similar file but as array of two dimensions.

回答(1 个)

KSSV
KSSV 2016-11-7
clc; clear all ;
C = rand(3,2) ;
% vertices of triangle
ver = [C ; C(1,:)] ;
% save into png
plot(ver(:,1),ver(:,2),'r')
saveas(gcf,'triangle.png')
% save vertices into txt file
save vertices.txt ver -ascii

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by