1.Problem 44929. Plot Line Specifications
Create a line plot for function cos(x) where x is a vector of linearly spaced values going from 0 to input N with an increment of 0.03 between values. Use a red dotted line with a * marker. The function must return the handle to your plot.
代码:
function f = cosplot(N)
x = 0:0.03:N;
y = cos(x);
plot(x, y,'*r:');
% 设置图形属性
xlabel('X-axis');
ylabel('cos(X)');
title('Cosine Plot');
f = gcf;
end