SourceCodePoint
Thursday, 7 July 2016
Write a MATLAB program for 2-D plot graph with title, legend, label
Code:
clc;
x = 0:0.01:2*pi;
y = sin(x);
z = cos(x);
figure
plot (x,y,x,z);
xlabel (
'X values'
);
ylabel (
'Y values'
);
title (
'Sample Plot'
);
legend (
'x data'
,
'y data'
);
grid
on
;
Output:
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment