outselect.m
版本 1.0.0.0 (1.5 KB) 作者:
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
引用格式
Toby Driscoll (2024). outselect.m (https://www.mathworks.com/matlabcentral/fileexchange/7913-outselect-m), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
创建方式
R14
兼容任何版本
平台兼容性
Windows macOS Linux类别
在 Help Center 和 MATLAB Answers 中查找有关 Characters and Strings 的更多信息
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
1.0.0.0 |