Create an x vector, and then two different vectors (y and z) based on x. Plot them with a legend. Use help legend to find out how to position the legend itself on the graph, and experiment with different locations
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:12| Question number:11.12
All Answers
total answers (1)
Ch12Ex11.m
% Create vectors, plot, and experiment with legend location
y = x.^2;
z = sqrt(x);
hold on
plot(x,y,'r-')
plot(x,z,'g-')
legend('x^2','sqrt(x)','Location','NorthWest')
need an explanation for this answer? contact us directly to get an explanation for this answer