Design the gt(>) method of function_handle so that:
>> 1 > @sin > @cos
ans =
0.666366745392881
>> cos(sin(1))
ans =
0.666366745392881
>> {1, 3, 3} > @linspace
ans =
1 2 3
>> linspace(1, 3, 3)
ans =
1 2 3
The gt.m you submitted will be moved to the class folder @function_handle:
mkdir @function_handle movefile submission/gt.m @function_handle
See Also: Problem 42817. Pipeline
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers3
Suggested Problems
More from this Author8
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
The problem seems to be unsolvable without "cheating".
Cody gives the errormessage "The function gt is a built-in MATLAB function. Please use a different function name."
Using a different function name, of cause, will not overload the operator '>'. How is the intended solution for the current Cody version???
@cokakola: I am not sure, either. The problem has been removed from the Functions II group.
Hi LY Cao — a gt.m method for @function_handle passes all four tests
locally in R2026a, but Cody rejects any submission named gt before
running the tests: "The function gt is a built-in MATLAB function.
Please use a different function name." (the same issue cokakola reported
in 2020). So the intended solution can't be submitted.
Could the test suite create the method itself, e.g. have the solution
be a helper function with a different name that the test copies into
@function_handle/gt.m before the asserts? Or could the Cody team exempt
this problem from the built-in name check? Thanks!