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 Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by