cau13 do thi co ban
1 Do hoa trong khong gian hai chieu.
1.1 Cac lenh ve co ban
De ve mot do thi co ban trong mat phang ta dung cau lenh plot. Lenh plot nay se ve do thi cua mot mang du lieu trong he truc thich hop va noi cac diem bang dong thang.
Vi du:
>> x=(1:0.1:7);
>> y=2*x.^2-x;
>> plot(x,y)
Ket qua se la
(*) Mot so lenh ve co ban
Ten lenhnghia
plot(x,y) Ve theo vector y va x (y ruc tung cua he, xtruc hoanh). Do thi tu doc se la tap cua cac diem (xi,yi)
plot(A,B) Voi A,B la cac ma tran. Ve cac cot cua A theo cac cot cua B. Neu A va B la 2 ma tran co cung do lon mxn thi ta se thu doc m do thi n diem.
plot(....,str) Ve do thi voi cac chi so ve mau sac va kieu dong theo bien str.
Ta co bang ve kieu dong va mau do thi nh sau.
Kieu duong Cach the hien Kieu duong Cach the hien
'' diem-ong lien net - duong lien net
* sao -- duong dut net
X chu cai x -. duong cham gach
O chu cai o : duong cham
+ dau cong
Ki hieu Mau the hien Ki hieu Mau the hien
Y vang C xanh la ma
G xanh la cay W trang
M do toi R do
B xanh lam K den
Vi du:
Ve do thi y=x3 voi mau la mau xanh va kieu duong +
>> x=linspace(1,100,100);
>> y=x.*x.*x;
>> plot(x,y,'b+')
Bạn đang đọc truyện trên: Truyen247.Pro