2D triangle.

7 vues (au cours des 30 derniers jours)
george samaras
george samaras le 7 Nov 2016
Réponse apportée : KSSV le 7 Nov 2016
how to create a 2D triangle and save it as png or something similar file but as array of two dimensions.

Réponses (1)

KSSV
KSSV le 7 Nov 2016
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

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by