2D triangle.
조회 수: 8 (최근 30일)
이전 댓글 표시
how to create a 2D triangle and save it as png or something similar file but as array of two dimensions.
댓글 수: 0
답변 (1개)
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
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!