Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 226245

Submitted on 2 Apr 2013

Incorrect

24Size
Leading solution size is 11.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Fail
 
%%
h = plot(1:10,1:10,'--r');
hold on
plot(1:10,0:9,'--b')
legend('Test1','Test2')
assert(isequal(h,GetHandleByName('Test1')))
Error: Output argument "h" (and maybe others) not assigned during call to "/users/msssystem7/GetHandleByName.m>GetHandleByName".
2
Fail
 
%%
close all
plot(rand(10,1),rand(10,1),'b.')
hold on
h = plot(rand(10,1),rand(10,1),'Marker','.','Color',rand(1,3));
plot(rand(10,1),rand(10,1),'--m')
legend('Test1','Test2','Test3')
assert(isequal(h,GetHandleByName('Test2')))
Error: Output argument "h" (and maybe others) not assigned during call to "/users/msssystem7/GetHandleByName.m>GetHandleByName".