MATLAB Helper Function - Price is Right Wheel Sketch
Draw 5 spaces of the wheel to the screen, the arrow, and populate the initial pricing array with all as global variables.
function drawWheel ()
global priceWheel;
global priceText;
global priceArrow;
global priceSpace;
global pricePos;
pricePos = int16(0);
% Price order (from Wiki)
priceWheel = {'0.05','1.00','0.15', '0.80', '0.35', '0.60', '0.20', '0.40', '0.75', '0.55', '0.95', '0.50', '0.85', '0.30', '0.65', '0.10', '0.45', '0.70', '0.25', '0.90'};
for j=1:5
priceText(j) = writeText(25.5, 37.5-j*5.25, priceWheel(j));
set(priceText(j),'FontName','FixedWidth')
set(priceText(j),'FontWeight','bold');
set(priceText(j), 'Clipping', 'off');
set(priceText(j), 'FontSize', 24);
% Rectangle
priceSpace(j) = drawRectangle(25,35-j*5.25,5,5);
set(priceSpace(j), 'FaceAlpha', 0.5);
end
priceArrow = drawRectangle(13.5,20,10,2);
drawTriangle(23,24.5,23,23.5,21,18.5,'red');
redraw
end