SUBSREF

From Jacket Wiki

Jump to: navigation, search
Back to Function List

Subscripted reference

Usage

Jacket for M Language
    Supported Syntax
    
B = subsref(A,S)
A(A > .5)
A(:,i)
    

GFOR Supported

Yes

GCOMPILE Supported

No

Types Supported

-  GDOUBLE   GSINGLE   GLOGICAL   GINT32   INT8   GUINT32   GUINT8   COMPLEX 

Types Not Supported

-

CPU usageJacket only contains GPU computing functions. To run functions on the CPU, try one of the MathWorks products:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/subsref.html

Notes

  • B = subsref(A,S) is called internally by MATLAB for the syntax A(i), A{i}, or A.i
  • Supports only GSINGLE, GDOUBLE, GLOGICAL, or CPU data as indices
>> A(1:4)
ans =
    0.0620    0.6746    0.7100    0.7672
>> A([1 2 2],3)
ans =
    0.9992
    0.5136
    0.5136
>> A(1:2,2)
ans =
    0.0207
    0.1531
>> A(A < 0.5)'
ans =
    0.0620    0.0207    0.1531    0.2626    0.4325    0.2978    0.4253
>> A(guint8([1 3 2]))
ans =
    0.0620    0.7100    0.6746
>> A(gsingle([1 3 2])) 
ans =
    0.0620    0.7100    0.6746

See Also

NUMEL, SUBSASGN, SUBSTRUCT

Personal tools