Write an m-file function called “plotsin” that will graphically demonstrate the difference in plotting the sin function with a different number of points in the range from 0 to 2π
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:7| Question number:14.7
All Answers
total answers (1)
plotsin.m
function plotsin(lowp, highp)
x = linspace(0,2*pi,lowp);
y = sin(x);
subplot(2,1,1)
plot(x,y)
title(sprintf('%d points',lowp))
subplot(2,1,2)
x = linspace(0,2*pi,highp);
y = sin(x);
plot(x,y)
title(sprintf('%d points',highp))
end
need an explanation for this answer? contact us directly to get an explanation for this answer