Create a simple plot and store the handle in a variable. Use the three different methods (dot notation, set, and structure) to change the Color property
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:11| Question number:2.11
All Answers
total answers (1)
>> x = -pi:0.01:2*pi;
>> y = sin(x);
>> ph = plot(x,y,'r*')
ph =
Line with properties:
Color: [1 0 0]
LineStyle: 'none'
LineWidth: 0.5000
Marker: '*'
MarkerSize: 6
MarkerFaceColor: 'none'
XData: [1x943 double]
YData: [1x943 double]
ZData: [1x0 double]
Show all properties
>> set(ph,'Color','g')
>> ph.Color = [1 1 0];
>> fstruct = get(ph) % to see Color only
fstruct =
Color: [1 1 0]
need an explanation for this answer? contact us directly to get an explanation for this answer