Function Reference: Volume 1 (A-E) - The MathWorks - #351

/ 1298


catalogue search
P. 351
P. 352
P. 353
P. 354
P. 355
P. 356
P. 357
P. 358
P. 359
P. 360
P. 361
P. 362
P. 363
P. 364
P. 365
P. 366
P. 367
P. 368
P. 369
P. 370
P. 371
P. 372
P. 373
P. 374
P. 375
P. 376
P. 377
P. 378
P. 379
P. 380
P. 381
P. 382
P. 383
P. 384
P. 385
P. 386
P. 387
P. 388
P. 389
P. 390
P. 391
P. 392
P. 393
P. 394
P. 395
P. 396
P. 397
P. 398
P. 399
P. 400


See other catalogues for The MathWorks

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

pageCatalog pdf di En 2012-06-22-01