outselect.m
Version 1.0.0.0 (1.51 KB) by
Toby Driscoll
Select or reorder any function's output arguments.
Occasionally you need only the kth output argument of a MATLAB function, where k>1. This function OUTSELECT provides this facility as a 'wrapper' around any other function. It can evaluate and return arguments immediately, or create a new callable function.
For example:
>> str = 'deacb'; [s,idx] = sort(str)
s =
abcde
idx =
3 5 4 1 2
>> [idx,s] = outselect([2 1],@sort,str)
idx =
3 5 4 1 2
s =
abcde
>> argmin = outselect(2,@min);
>> argmin(str)
ans =
3
Cite As
Toby Driscoll (2026). outselect.m (https://in.mathworks.com/matlabcentral/fileexchange/7913-outselect-m), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R14
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Characters and Strings in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
