Write a script that will prompt the user for a character. It will create an x-vector that has 50 numbers, equally spaced between -2π and 2π, and then a y-vector which is cos(x)
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:4| Question number:10.4
All Answers
total answers (1)
Ch4Ex10.m
color = input('Enter a char for a color: ', 's');
x = linspace(-2*pi, 2*pi, 50);
y = cos(x);
if color == 'r'
plot(x,y,'r*')
else
plot(x,y,'g+')
end
need an explanation for this answer? contact us directly to get an explanation for this answer