Find the Built-In functions and Toolbox functions in either a string or a function handle.
Generate a string of alphabetized Built-In functions followed by alphabetized Functions.
Inputs:
fh=@(x)log10(x)+log2(x)+abs(x)
str='smooth3(x,y)-filter(x)+abs(n)+filter2(u)+sin(x)+numel(z)'
Outputs:
'abs log2 log10'
'abs filter numel sin filter2 smooth3'
Related to Cody_464
Solution Stats
Problem Comments
6 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers81
Suggested Problems
-
Remove any row in which a NaN appears
8770 Solvers
-
Convert a numerical matrix into a cell array of strings
2386 Solvers
-
1506 Solvers
-
Put two time series onto the same time basis
350 Solvers
-
How long do each of the stages of the rocket take to burn?
456 Solvers
More from this Author308
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Richard: I believe there are a couple of inconsistencies in the test cases.
- You mention in the problem statement that the 'alphabetized built-in' functions should follow 'alphabetized' functions. However, 'log10' (not built-in) appears before 'log2' (built-in).
- 'i' is also a built-in function. 'which i' indicates that.
'i' in test case 2 is also 'built-in'
I agree , exist('i') return 5 .
I changed hte "i" to "k".
Even though "i" was being used as a variable and not in its capacity as a built-in function.
In what order the names of the function are sorted?
(Thanks for the useful tags.)
The functions are sorted alphabetically and by type.
Ex. [built_in_alphabetical, toolkit_alphabetical]