Cody

Problem 1744. Make a Plot with Functions

Solution 1410731

Submitted on 9 Jan 2018 by Rafael Hernandez-Walls
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = rand(10,1); y = rand(1,10); colors = ['g', 'r', 'b']; colorNum = randi(length(colors)); color = colors(colorNum); colorCodes = {[0 1 0], [1 0 0], [0 0 1]}; color_correct = colorCodes{colorNum}; h = makeAPlot(x,y,color); poltHandle = get(h); plotColor = poltHandle(1).Color; plotX = poltHandle(1).XData; plotY = poltHandle(1).YData; assert(isequal(plotColor,color_correct)) assert(isequal(plotX',x)) assert(isequal(plotY,y))

h = Line with properties: Color: [1 0 0] LineStyle: '-' LineWidth: 0.5000 Marker: 'none' MarkerSize: 6 MarkerFaceColor: 'none' XData: [0.4683 0.7430 0.0208 0.8453 0.8372 0.6788 0.8059 0.9315 0.6858 0.6848] YData: [0.7863 0.2653 0.5768 0.3287 0.9624 0.6753 0.9959 0.2663 0.0713 0.9260] ZData: [1×0 double] Show all properties

  

Suggested Problems

More from this Author2

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!