Problem 1210. Two-output anonymous function?
Return a function handle that when applied to an input, it produces two outputs: the first is the same as the input, and the second is the element-wise square of the input.
Example:
f=f2f(); [a b]=f([1 2 3])
a = 1 2 3
b = 1 4 9
Solution Stats
Problem Comments
-
2 Comments
Marco Castelli
on 19 Jan 2013
What is Function-name? is it f2f or f?
Daigo
on 25 Mar 2022
I have no idea how to solve this. Give me any hint!
Solution Comments
Show commentsProblem Recent Solvers84
Suggested Problems
-
Project Euler: Problem 6, Natural numbers, squares and sums.
2530 Solvers
-
Number of 1s in a binary string
10906 Solvers
-
Getting the indices from a vector
11709 Solvers
-
How long do each of the stages of the rocket take to burn?
442 Solvers
-
5584 Solvers
More from this Author11
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!