See other catalogues for
The MathWorks
You may also be interested in
Text version of the page
| | | | | | | | | | | | | |
| | | |
| | | arrayfun | | |
| | | |
| | | Parameters recognized by arrayfun are shown below. Enclose each parameternamewithsinglequotes. | | |
| | | |
| | | | | | | | | | Parameter Name | Parameter Value | | | | UniformOutput | Alogical 1(true)or0(false), indicating whetherornot theoutputsof fun can be returned without encapsulation in a cell array. If true (the default), fun must return scalar values that can be concatenated into an array. These values can also be a cell array. If false, arrayfun returns a cell array (or multiple cell arrays), where the (I,J,...) th cell contains the value fun(S(I,J,...), ...). | | | | ErrorHandler | A function handle, specifying the function that arrayfun is to call ifthe call to fun fails. If an error handler is not specified, arrayfun rethrows the error from the call to fun. | | | | | | | | | |
| | | |
| | | Remarks MATLAB® provides two functions that are similar to arrayfun;these are structfun and cellfun.With structfun, you can apply a given function to all fields ofone or more structures. With cellfun, you apply the function to all cells of one or more cell arrays. Examples Example 1 — Operating on a Single Input. Create a 1-by-15 structure array with fields f1 and f2,each field containing an array of a different size. Make each f1 field be unequal to the f2 fieldatthatsamearrayindex: for k=1:15 s(k).f1 = rand(k+3,k+7) * 10; s(k).f2 = rand(k+3,k+7) * 10; | | |
| | | |
| | | 2-225 | | |
| | | |
| | | | | | | | | | | | | |