Q:

Ch12Ex14.m % Plot line y = x with a random thickness x = [2 5]; y = x; hdl = plot(x,y); title('Line with random thickness') set(hdl,'LineWidth',randi([1 10]))

0

Write a script that will plot the data points from y and z data vectors, and store the handles of the two plots in variables yhand and zhand. Set the line widths to 3 and 4 respectively. Set the colors and markers to random values (create strings containing possible values and pick a random index).

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Ch12Ex15.m

y = [33 22 17 32 11];

z = [3 7 2 9 4 6 2 3];

figure(1)

yhand = plot(y);

figure(2)

zhand = plot(z);

somecolors = 'bgrcmyk';

somemarkers = '.ox+*sd';

set(yhand,'LineWidth',3, ...

 'Color',somecolors(randi(length(somecolors))))

set(zhand,'LineWidth',4,...

 'Color',somecolors(randi(length(somecolors))))

set(yhand, 'Marker',...

 somemarkers(randi(length(somemarkers))))

set(zhand, 'Marker', ...

 somemarkers(randi(length(somemarkers))))

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now