Jump to content

Julia for MATLAB Users/Core Language/Language Fundamentals

From Wikibooks, open books for an open world

Language Fundamentals

[edit | edit source]

This page maps MATLAB functionality documented in the Language Fundamentals section of the MATLAB documentation to equivalent Julia (core language and/or package) functionality.

Another helpful resource is the noteworthy differences from MATLAB section of the Julia documentation.

Entering Commands

[edit | edit source]

Related: Julia REPL

ans Most recent answer
[edit | edit source]

Julia's ans is functionally basically identical, though note that it is available only at the REPL.

clc Clear Command Window
[edit | edit source]

Ctrl+L is nearly equivalent in the Julia REPL, though it does not erase history; you can still scroll up to see the history of the session. You can also equivalently (on Linux/Mac) run the clear(1) command in shell mode, i.e. ;+clear.

save Command Window text to file
[edit | edit source]

There doesn't appear to be an equivalent Julia REPL command.

format Set Command Window output display format
[edit | edit source]

There is no drop-in equivalent in the Julia REPL or IJulia for globally setting the output format.

home Send cursor home
[edit | edit source]

Ctrl+L is functionally equivalent in the Julia REPL.

iskeyword Determine whether input is MATLAB keyword
[edit | edit source]

There doesn't appear to be an equivalent Julia command, but see Keywords in the Julia manual.

more Control paged output for Command Window
[edit | edit source]

Matrices and Arrays

[edit | edit source]

See Multi-dimensional Arrays in the Julia Manual.

zeros Create array of all zeros; ones Create array of all ones
[edit | edit source]

Julia's zeros and ones are functionally equivalent. Note that the syntax for specifying the data type of the result is different, e.g. Julia: zeros(Int64, 3, 3) vs. MATLAB zeros(3,3, 'int64').

rand Uniformly distributed random numbers
[edit | edit source]

See Julia's rand.

true Logical 1 (true); false Logical 0 (false)
[edit | edit source]
eye Identity matrix
[edit | edit source]

In Julia to construct a numeric identity matrix, use something like Matrix(1.0I, 3, 3). Note that the symbol I is special in Julia; rather than representing a matrix, it is an instance of the UniformScaling operator so that in principle its use can be more efficient than the naive use of a dense matrix that happens to have 1's on the diagonal and zeros elsewhere.

diag Create diagonal matrix or get diagonal elements of matrix
[edit | edit source]
blkdiag Construct block diagonal matrix from input arguments
[edit | edit source]
cat Concatenate arrays along specified dimension
[edit | edit source]
horzcat Concatenate arrays horizontally
[edit | edit source]

See Julia's hcat function

vertcat Concatenate arrays vertically
[edit | edit source]
repelem Repeat copies of array elements
[edit | edit source]
repmat Repeat copies of array
[edit | edit source]
linspace Generate linearly spaced vector
[edit | edit source]
logspace Generate logarithmically spaced vector
[edit | edit source]
freqspace Frequency spacing for frequency response
[edit | edit source]
meshgrid 2-D and 3-D grids
[edit | edit source]
ndgrid Rectangular grid in N-D space
[edit | edit source]
length Length of largest array dimension
[edit | edit source]

Julia has a length function, however it does not operate the same way as Matlab's for multidimensional arrays. To get equivalent behavior to Matlab's length(X), use maximum(size(X)) in Julia.

size Array size
[edit | edit source]
ndims Number of array dimensions
[edit | edit source]

In Julia, ndims is similar but not identical. For instance, Julia does not ignore singleton dimensions.

numel Number of array elements
[edit | edit source]

In Julia, length is equivalent.

isscalar Determine whether input is scalar
[edit | edit source]
isvector Determine whether input is vector
[edit | edit source]
ismatrix Determine whether input is matrix
[edit | edit source]
isrow Determine whether input is row vector
[edit | edit source]
iscolumn Determine whether input is column vector
[edit | edit source]
isempty Determine whether array is empty
[edit | edit source]
sort Sort array elements
[edit | edit source]
sortrows Sort rows of matrix or table
[edit | edit source]
issorted Determine if array is sorted
[edit | edit source]
issortedrows Determine if matrix or table rows are sorted
[edit | edit source]
topkrows Top rows in sorted order
[edit | edit source]
flip Flip order of elements
[edit | edit source]
fliplr Flip array left to right
[edit | edit source]
flipud Flip array up to down
[edit | edit source]
rot90 Rotate array 90 degrees
[edit | edit source]
transpose Transpose vector or matrix
[edit | edit source]
ctranspose Complex conjugate transpose
[edit | edit source]
permute Rearrange dimensions of N-D array
[edit | edit source]
ipermute Inverse permute dimensions of N-D array
[edit | edit source]
circshift Shift array circularly
[edit | edit source]
shiftdim Shift dimensions
[edit | edit source]
reshape Reshape array
[edit | edit source]
squeeze Remove singleton dimensions
[edit | edit source]

Julia's dropdims function is similar though it requires the singleton dimension(s) to be specified explicitly.

colon Vector creation, array subscripting, and for-loop iteration
[edit | edit source]
end Terminate block of code, or indicate last array index
[edit | edit source]

Julia's end is basically equivalent.

ind2sub Subscripts from linear index
[edit | edit source]
sub2ind Convert subscripts to linear indices
[edit | edit source]

Operators and Elementary Operations

[edit | edit source]

See Mathematical Operations and Elementary Functions in the Julia manual.

Arithmetic

[edit | edit source]
plus Addition
[edit | edit source]
uplus Unary plus
[edit | edit source]
minus Subtraction
[edit | edit source]
uminus Unary minus
[edit | edit source]
times Element-wise multiplication
[edit | edit source]
rdivide Right array division
[edit | edit source]
ldivide Left array division
[edit | edit source]
power Element-wise power
[edit | edit source]
mtimes Matrix Multiplication
[edit | edit source]
mrdivide Solve systems of linear equations xA = B for x
[edit | edit source]
mldivide Solve systems of linear equations Ax = B for x
[edit | edit source]
mpower Matrix power
[edit | edit source]
cumprod Cumulative product
[edit | edit source]
cumsum Cumulative sum
[edit | edit source]
diff Differences and Approximate Derivatives
[edit | edit source]
movsum Moving sum
[edit | edit source]
prod Product of array elements
[edit | edit source]
sum Sum of array elements
[edit | edit source]
ceil Round toward positive infinity
[edit | edit source]
fix Round toward zero
[edit | edit source]
floor Round toward negative infinity
[edit | edit source]
idivide Integer division with rounding option
[edit | edit source]
mod Remainder after division (modulo operation)
[edit | edit source]
rem Remainder after division
[edit | edit source]
round Round to nearest decimal or integer
[edit | edit source]
bsxfun Apply element-wise operation to two arrays with implicit expansion enabled
[edit | edit source]

Relational Operations

[edit | edit source]
eq Determine equality
[edit | edit source]
ge Determine greater than or equal to
[edit | edit source]
gt Determine greater than
[edit | edit source]
le Determine less than or equal to
[edit | edit source]
lt Determine less than
[edit | edit source]
ne Determine inequality
[edit | edit source]
isequal Determine array equality
[edit | edit source]
isequaln Determine array equality, treating NaN values as equal
[edit | edit source]

Logical Operations

[edit | edit source]

Logical Operators: Short-circuit Logical operations with short-circuiting

[edit | edit source]
and Find logical AND
[edit | edit source]
not Find logical NOT
[edit | edit source]
or Find logical OR
[edit | edit source]
xor Find logical exclusive-OR
[edit | edit source]
all Determine if all array elements are nonzero or true
[edit | edit source]
any Determine if any array elements are nonzero
[edit | edit source]
false Logical 0 (false)
[edit | edit source]
find Find indices and values of nonzero elements
[edit | edit source]

In Julia, findall provides similar functionality. See also findfirst, findlast, findnext and findprev.

islogical Determine if input is logical array
[edit | edit source]
logical Convert numeric values to logicals
[edit | edit source]
true Logical 1 (true)
[edit | edit source]

Set Operations

[edit | edit source]

intersect Set intersection of two arrays

[edit | edit source]

ismember Array elements that are members of set array

[edit | edit source]

ismembertol Members of set within tolerance

[edit | edit source]

issorted Determine if array is sorted

[edit | edit source]

setdiff Set difference of two arrays

[edit | edit source]

setxor Set exclusive OR of two arrays

[edit | edit source]

union Set union of two arrays

[edit | edit source]

unique Unique values in array

[edit | edit source]

uniquetol Unique values within tolerance

[edit | edit source]

join Combine two tables or timetables by rows using key variables

[edit | edit source]

innerjoin Inner join between two tables or timetables

[edit | edit source]

outerjoin Outer join between two tables or timetables

[edit | edit source]

Bit-Wise Operations

[edit | edit source]

bitand Bit-wise AND

[edit | edit source]

bitcmp Bit-wise complement

[edit | edit source]

bitget Get bit at specified position

[edit | edit source]

bitor Bit-wise OR

[edit | edit source]

bitset Set bit at specific location

[edit | edit source]

bitshift Shift bits specified number of places

[edit | edit source]

bitxor Bit-wise XOR

[edit | edit source]

swapbytes Swap byte ordering

[edit | edit source]

Data Types

[edit | edit source]

See Types in the Julia manual.

Numeric Types

[edit | edit source]

double Double-precision arrays

[edit | edit source]

single Single-precision arrays

[edit | edit source]

int8 8-bit signed integer arrays

[edit | edit source]

int16 16-bit signed integer arrays

[edit | edit source]

int32 32-bit signed integer arrays

[edit | edit source]

int64 64-bit signed integer arrays

[edit | edit source]

uint8 8-bit unsigned integer arrays

[edit | edit source]

uint16 16-bit unsigned integer arrays

[edit | edit source]

uint32 32-bit unsigned integer arrays

[edit | edit source]

uint64 64-bit unsigned integer arrays

[edit | edit source]

cast Cast variable to different data type

[edit | edit source]

typecast Convert data types without changing underlying data

[edit | edit source]

isinteger Determine if input is integer array

[edit | edit source]

isfloat Determine if input is floating-point array

[edit | edit source]

isnumeric Determine if input is numeric array

[edit | edit source]

isreal Determine whether array is real

[edit | edit source]

isfinite Array elements that are finite

[edit | edit source]

isinf Array elements that are infinite

[edit | edit source]

isnan Array elements that are NaN

[edit | edit source]

eps Floating-point relative accuracy

[edit | edit source]

flintmax Largest consecutive integer in floating-point format

[edit | edit source]

Inf Infinity

[edit | edit source]

intmax Largest value of specified integer type

[edit | edit source]

intmin Smallest value of specified integer type

[edit | edit source]

NaN Not-a-Number

[edit | edit source]

realmax Largest positive floating-point number

[edit | edit source]

realmin Smallest positive normalized floating-point number

[edit | edit source]

Characters and Strings

[edit | edit source]

string String array

[edit | edit source]

strings Create array of strings with no characters

[edit | edit source]

join Combine strings

[edit | edit source]

char Character array

[edit | edit source]

cellstr Convert to cell array of character vectors

[edit | edit source]

blanks Create character array of blanks

[edit | edit source]

newline Create newline character

[edit | edit source]

compose Convert data into formatted string array

[edit | edit source]

sprintf Format data into string

[edit | edit source]

strcat Concatenate strings horizontally

[edit | edit source]

cOnverTcHarstostrings Convert character arrays to string arrays, leaving other arrays unaltered

[edit | edit source]

cOnvertsTrIngstoChars Convert string arrays to character arrays, leaving other arrays unaltered

[edit | edit source]

ischar Determine if input is character array

[edit | edit source]

iscellstr Determine if input is cell array of character vectors

[edit | edit source]

isstring Determine if input is string array

[edit | edit source]

isStringScalar Determine if input is string array with one element

[edit | edit source]

strlength Length of strings in string array

[edit | edit source]

isstrprop Determine if string is of specified category

[edit | edit source]

isletter Determine which characters are letters

[edit | edit source]

isspace Determine which characters are space characters

[edit | edit source]

contains Determine if pattern is in string

[edit | edit source]

count Count occurrences of pattern in string

[edit | edit source]

endsWith Determine if string ends with pattern

[edit | edit source]

StartsWith Determine if string starts with pattern

[edit | edit source]

strfind Find one string within another

[edit | edit source]

sscanf Read formatted data from string

[edit | edit source]

replace Find and replace substrings in string array

[edit | edit source]

rEplacebetween Replace substrings identified by indicators that mark their starts and ends

[edit | edit source]

strrep Find and replace substring

[edit | edit source]

join Combine strings

[edit | edit source]

split Split strings in string array

[edit | edit source]

splitlines Split string at newline characters

[edit | edit source]

strjoin Join text in array

[edit | edit source]

strsplit Split string at specified delimiter

[edit | edit source]

strtok Selected parts of string

[edit | edit source]

erase Delete substrings within strings

[edit | edit source]

erasebetween Delete substrings between indicators that mark starts and ends of substrings

[edit | edit source]

eXtractAfter Extract substring after specified position

[edit | edit source]

eXtractBefore Extract substring before specified position

[edit | edit source]

eXtractbetween Extract substrings between indicators that mark starts and ends of substrings

[edit | edit source]

InsertAfter Insert string after specified substring

[edit | edit source]

InsertBefore Insert string before specified substring

[edit | edit source]

pad Add leading or trailing characters to strings

[edit | edit source]

strip Remove leading and trailing characters from string

[edit | edit source]

lower Convert string to lowercase

[edit | edit source]

upper Convert string to uppercase

[edit | edit source]

reverse Reverse order of characters in string

[edit | edit source]

deblank Remove trailing whitespace from end of string or character array

[edit | edit source]

strtrim Remove leading and trailing whitespace from string array or character array

[edit | edit source]

strjust Justify string or character array

[edit | edit source]

strcmp Compare strings

[edit | edit source]

strcmpi Compare strings (case insensitive)

[edit | edit source]

strncmp Compare first n characters of strings (case sensitive)

[edit | edit source]

strncmpi Compare first n characters of strings (case insensitive)

[edit | edit source]

regexp Match regular expression (case sensitive)

[edit | edit source]

regexpi Match regular expression (case insensitive)

[edit | edit source]

regexprep Replace text using regular expression

[edit | edit source]

regexptranslate Translate text into regular expression

[edit | edit source]

Dates and Time

[edit | edit source]

datetime Arrays that represent points in time

[edit | edit source]

NaT Not-a-Time

[edit | edit source]

years Duration in years

[edit | edit source]

days Duration in days

[edit | edit source]

hours Duration in hours

[edit | edit source]

minutes Duration in minutes

[edit | edit source]

seconds Duration in seconds

[edit | edit source]

milliseconds Duration in milliseconds

[edit | edit source]

duration Lengths of time in fixed-length units

[edit | edit source]

calyears Calendar duration in years

[edit | edit source]

calquarters Calendar duration in quarters

[edit | edit source]

calmonths Calendar duration in months

[edit | edit source]

calweeks Calendar duration in weeks

[edit | edit source]

caldays Calendar duration in days

[edit | edit source]

caLendarduration Lengths of time in variable-length calendar units

[edit | edit source]

year Year number

[edit | edit source]

quarter Quarter number

[edit | edit source]

month Month number and name

[edit | edit source]

week Week number

[edit | edit source]

day Day number or name

[edit | edit source]

hour Hour number

[edit | edit source]

minute Minute number

[edit | edit source]

second Second number

[edit | edit source]

ymd Year, month, and day numbers of datetime

[edit | edit source]

hms Hour, minute, and second numbers of duration

[edit | edit source]

split Split calendar duration into numeric and duration units

[edit | edit source]

time Convert time of calendar duration to duration

[edit | edit source]

timeofday Elapsed time since midnight for datetimes

[edit | edit source]

isdatetime Determine if input is datetime array

[edit | edit source]

isduration Determine if input is duration array

[edit | edit source]

iscalendarduration Determine if input is calendar duration array

[edit | edit source]

isnat Determine NaT (Not-a-Time) elements

[edit | edit source]

isdst Determine daylight saving time elements

[edit | edit source]

isweekend Determine weekend elements

[edit | edit source]

timezones List time zones

[edit | edit source]

tzoffset Time zone offset from UTC

[edit | edit source]

between Calendar math differences

[edit | edit source]

caldiff Calendar math successive differences

[edit | edit source]

dateshift Shift date or generate sequence of dates and time

[edit | edit source]

isbetween Determine elements within date and time interval

[edit | edit source]

datenum Convert date and time to serial date number

[edit | edit source]

datevec Convert date and time to vector of components

[edit | edit source]

exceltime Convert MATLAB datetime to Excel date number

[edit | edit source]

juliandate Convert MATLAB datetime to Julian date

[edit | edit source]

posixtime Convert MATLAB datetime to POSIX time

[edit | edit source]

yyyymmdd Convert MATLAB datetime to YYYYMMDD numeric value

[edit | edit source]

addtodate Modify date number by field

[edit | edit source]

char Character array

[edit | edit source]

string String array

[edit | edit source]

datestr Convert date and time to string format

[edit | edit source]

now Current date and time as serial date number

[edit | edit source]

clock Current date and time as date vector

[edit | edit source]

date Current date string

[edit | edit source]

calendar Calendar for specified month

[edit | edit source]

eomday Last day of month

[edit | edit source]

weekday Day of week

[edit | edit source]

etime Time elapsed between date vectors

[edit | edit source]

Categorical Arrays

[edit | edit source]

categorical Array that contains values assigned to categories

[edit | edit source]

iscategorical Determine whether input is categorical array

[edit | edit source]

discretize Group data into bins or categories

[edit | edit source]

categories Categories of categorical array

[edit | edit source]

iscategory Test for categorical array categories

[edit | edit source]

isordinal Determine whether input is ordinal categorical array

[edit | edit source]

isprotected Determine whether categories of categorical array are protected

[edit | edit source]

addcats Add categories to categorical array

[edit | edit source]

mergecats Merge categories in categorical array

[edit | edit source]

removecats Remove categories from categorical array

[edit | edit source]

renamecats Rename categories in categorical array

[edit | edit source]

reordercats Reorder categories in categorical array

[edit | edit source]

setcats Set categories in categorical array

[edit | edit source]

summary Print summary of table, timetable, or categorical array

[edit | edit source]

countcats Count occurrences of categorical array elements by category

[edit | edit source]

isundefined Find undefined elements in categorical array

[edit | edit source]

Tables

[edit | edit source]

table Table array with named variables that can contain different types

[edit | edit source]

array2table Convert homogeneous array to table

[edit | edit source]

cell2table Convert cell array to table

[edit | edit source]

struct2table Convert structure array to table

[edit | edit source]

table2array Convert table to homogeneous array

[edit | edit source]

table2cell Convert table to cell array

[edit | edit source]

table2struct Convert table to structure array

[edit | edit source]

table2timetable Convert table to timetable

[edit | edit source]

timetable2table Convert timetable to table

[edit | edit source]

readtable Create table from file

[edit | edit source]

writetable Write table to file

[edit | edit source]

DetectImportoptions Create import options based on file content

[edit | edit source]

getvaropts Get variable import options

[edit | edit source]

setvaropts Set variable import options

[edit | edit source]

setvartype Set variable data types

[edit | edit source]

head Get top rows of table, timetable, or tall array

[edit | edit source]

tail Get bottom rows of table, timetable, or tall array

[edit | edit source]

summary Print summary of table, timetable, or categorical array

[edit | edit source]

height Number of table rows

[edit | edit source]

width Number of table variables

[edit | edit source]

istable Determine whether input is table

[edit | edit source]

sortrows Sort rows of matrix or table

[edit | edit source]

unique Unique values in array

[edit | edit source]

issortedrows Determine if matrix or table rows are sorted

[edit | edit source]

topkrows Top rows in sorted order

[edit | edit source]

addvars Add variables to table or timetable

[edit | edit source]

movevars Move variables in table or timetable

[edit | edit source]

removevars Delete variables from table or timetable

[edit | edit source]

splitvars Split multicolumn variables in table or timetable

[edit | edit source]

mergevars Combine table or timetable variables into multicolumn variable

[edit | edit source]

vartype Subscript into table or timetable by variable type

[edit | edit source]

rows2vars Reorient table or timetable so that rows become variables

[edit | edit source]

stack Stack data from multiple variables into single variable

[edit | edit source]

unstack Unstack data from single variable into multiple variables

[edit | edit source]

inner2outer Invert nested table-in-table hierarchy in tables or timetables

[edit | edit source]

join Combine two tables or timetables by rows using key variables

[edit | edit source]

innerjoin Inner join between two tables or timetables

[edit | edit source]

outerjoin Outer join between two tables or timetables

[edit | edit source]

union Set union of two arrays

[edit | edit source]

intersect Set intersection of two arrays

[edit | edit source]

ismember Array elements that are members of set array

[edit | edit source]

setdiff Set difference of two arrays

[edit | edit source]

setxor Set exclusive OR of two arrays

[edit | edit source]

ismissing Find missing values

[edit | edit source]

standArdizemissing Insert standard missing values

[edit | edit source]

rmmissing Remove missing entries

[edit | edit source]

fillmissing Fill missing values

[edit | edit source]

varfun Apply function to table or timetable variables

[edit | edit source]

rowfun Apply function to table or timetable rows

[edit | edit source]

findgroups Find groups and return group numbers

[edit | edit source]

splitapply Split data into groups and apply function

[edit | edit source]

groupsummary Group summary computations

[edit | edit source]

Timetables

[edit | edit source]

timetable Timetable array with time-stamped rows and variables of different types

[edit | edit source]

retime resample or aggregate data in timetable, and resolve duplicate or irregular times

[edit | edit source]

synchronize synchronize timetables to common time vector, and resample or aggregate data from input timetables

[edit | edit source]

lag Time-shift data in timetable

[edit | edit source]

table2timetable Convert table to timetable

[edit | edit source]

array2timetable Convert homogeneous array to timetable

[edit | edit source]

timetable2table Convert timetable to table

[edit | edit source]

istimetable Determine if input is timetable

[edit | edit source]

isregular Determine whether times in timetable are regular

[edit | edit source]

timerange Time range for timetable row subscripting

[edit | edit source]

withtol Time tolerance for timetable row subscripting

[edit | edit source]

vartype Subscript into table or timetable by variable type

[edit | edit source]

rmmissing Remove missing entries

[edit | edit source]

issorted Determine if array is sorted

[edit | edit source]

sortrows Sort rows of matrix or table

[edit | edit source]

unique Unique values in array

[edit | edit source]

Structures

[edit | edit source]

struct Structure array

[edit | edit source]

fieldnames Field names of structure, or public fields of COM or Java object

[edit | edit source]

getfield Field of structure array

[edit | edit source]

isfield Determine whether input is structure array field

[edit | edit source]

isstruct Determine whether input is structure array

[edit | edit source]

orderfields Order fields of structure array

[edit | edit source]

rmfield Remove fields from structure

[edit | edit source]

setfield Assign values to structure array field

[edit | edit source]

arrayfun Apply function to each element of array

[edit | edit source]

structfun Apply function to each field of scalar structure

[edit | edit source]

table2struct Convert table to structure array

[edit | edit source]

struct2table Convert structure array to table

[edit | edit source]

cell2struct Convert cell array to structure array

[edit | edit source]

struct2cell Convert structure to cell array

[edit | edit source]

Cell Arrays

[edit | edit source]

cell Cell array

[edit | edit source]

cell2mat Convert cell array to ordinary array of the underlying data type

[edit | edit source]

cell2struct Convert cell array to structure array

[edit | edit source]

cell2table Convert cell array to table

[edit | edit source]

celldisp Display cell array contents

[edit | edit source]

cellfun Apply function to each cell in cell array

[edit | edit source]

cellplot Graphically display structure of cell array

[edit | edit source]

cellstr Convert to cell array of character vectors

[edit | edit source]

iscell Determine whether input is cell array

[edit | edit source]

iscellstr Determine if input is cell array of character vectors

[edit | edit source]

mat2cell Convert array to cell array with potentially different sized cells

[edit | edit source]

num2cell Convert array to cell array with consistently sized cells

[edit | edit source]

strjoin Join text in array

[edit | edit source]

strsplit Split string at specified delimiter

[edit | edit source]

struct2cell Convert structure to cell array

[edit | edit source]

table2cell Convert table to cell array

[edit | edit source]

Function Handles

[edit | edit source]

feval Evaluate function

[edit | edit source]

func2str Construct character vector from function handle

[edit | edit source]

str2func Construct function handle from character vector

[edit | edit source]

localfunctions Function handles to all local functions in MATLAB file

[edit | edit source]

functions Information about function handle

[edit | edit source]

Map Containers

[edit | edit source]

containers.Map Object that maps values to unique keys

[edit | edit source]

isKey Determine if Map object contains key

[edit | edit source]

keys Return keys of Map object

[edit | edit source]

remove Delete key-value pairs from Map object

[edit | edit source]

values Return values of Map object

[edit | edit source]

Time Series

[edit | edit source]

Time Series Objects

[edit | edit source]
timeseries Create timeseries object
[edit | edit source]
addevent Add event to timeseries
[edit | edit source]
addsample Add data sample to timeseries object
[edit | edit source]
append Concatenate timeseries objects in time
[edit | edit source]
delevent Remove event from timeseries
[edit | edit source]
delsample Remove sample from timeseries object
[edit | edit source]
detrend Subtract mean or best-fit line from timeseries object
[edit | edit source]
filter Modify frequency content of timeseries objects
[edit | edit source]
idealfilter timeseries ideal filter
[edit | edit source]
plot Plot timeseries
[edit | edit source]
resample Resample timeseries time vector
[edit | edit source]
set Set timeseries properties
[edit | edit source]
setabstime Set timeseries times as date character vectors
[edit | edit source]
setinterpfunction Set default interpolation method for timeseries object
[edit | edit source]
setuniformtime Modify uniform timeseries time vector
[edit | edit source]
synchronize Synchronize and resample two timeseries objects using common time vector
[edit | edit source]
get Query timeseries properties
[edit | edit source]
getabstime Convert timeseries time vector to cell array
[edit | edit source]
getdatasamples Access timeseries data samples
[edit | edit source]
getdatasamplesize timeseries data sample size
[edit | edit source]
getinterpmethod timeseries interpolation method
[edit | edit source]
getqualitydesc timeseries data quality
[edit | edit source]
getsamples Subset of timeseries
[edit | edit source]
getsampleusingtime Subset of timeseries data
[edit | edit source]
gettsafteratevent Create timeseries at or after event
[edit | edit source]
gettsafterevent Create timeseries after event
[edit | edit source]
gettsatevent Create timeseries at event
[edit | edit source]
gettsbeforeatevent Create timeseries at or before event
[edit | edit source]
gettsbeforeevent Create timeseries before event
[edit | edit source]
gettsbetweenevents Create timeseries between events
[edit | edit source]
iqr Interquartile range of timeseries data
[edit | edit source]
max Maximum of timeseries data
[edit | edit source]
mean Mean of timeseries data
[edit | edit source]
median Median of timeseries data
[edit | edit source]
min Minimum of timeseries data
[edit | edit source]
std Standard deviation of timeseries data
[edit | edit source]
sum Sum of timeseries data
[edit | edit source]
var Variance of timeseries data
[edit | edit source]

Time Series Collections

[edit | edit source]
tscollection Create tscollection object
[edit | edit source]
addsampletocollection Add sample to tscollection
[edit | edit source]
addts Add timeseries to tscollection
[edit | edit source]
delsamplefromcollection Delete sample from tscollection
[edit | edit source]
horzcat Horizontally concatenate tscollection objects
[edit | edit source]
removets Remove timeseries from tscollection
[edit | edit source]
resample Resample tscollection time vector
[edit | edit source]
set Set tscollection properties
[edit | edit source]
setabstime Set tscollection times as date character vectors
[edit | edit source]
settimeseriesnames Rename timeseries in tscollection
[edit | edit source]
vertcat Vertically concatenate tscollection objects
[edit | edit source]
get Query tscollection properties
[edit | edit source]
getabstime Convert tscollection time vector to cell array
[edit | edit source]
getsampleusingtime Subset of tscollection data
[edit | edit source]
gettimeseriesnames Names of timeseries in tscollection
[edit | edit source]
isempty Determine if tscollection is empty
[edit | edit source]
length Length of tscollection time vector
[edit | edit source]
size Size of tscollection
[edit | edit source]

Time Series Events

[edit | edit source]
tsdata.event Create tsdata.event object
[edit | edit source]
findEvent Query tsdata.event by name
[edit | edit source]
get Query tsdata.event properties
[edit | edit source]
gEttimeStr Query tsdata.event times
[edit | edit source]
set Set tsdata.event properties
[edit | edit source]

Data Type Identification

[edit | edit source]

iscalendarduration Determine if input is calendar duration array

[edit | edit source]

iscategorical Determine whether input is categorical array

[edit | edit source]

iscell Determine whether input is cell array

[edit | edit source]

iscellstr Determine if input is cell array of character vectors

[edit | edit source]

ischar Determine if input is character array

[edit | edit source]

isdatetime Determine if input is datetime array

[edit | edit source]

isduration Determine if input is duration array

[edit | edit source]

isenum Determine if variable is enumeration

[edit | edit source]

isfloat Determine if input is floating-point array

[edit | edit source]

isgraphics True for valid graphics object handles

[edit | edit source]

isinteger Determine if input is integer array

[edit | edit source]

isjava Determine if input is Java object

[edit | edit source]

islogical Determine if input is logical array

[edit | edit source]

isnumeric Determine if input is numeric array

[edit | edit source]

isobject Determine if input is MATLAB object

[edit | edit source]

isreal Determine whether array is real

[edit | edit source]

isstring Determine if input is string array

[edit | edit source]

isstruct Determine whether input is structure array

[edit | edit source]

istable Determine whether input is table

[edit | edit source]

istimetable Determine if input is timetable

[edit | edit source]

is Detect state

[edit | edit source]

isa Determine if input is object of specified class

[edit | edit source]

class Determine class of object

[edit | edit source]

validateattributes Check validity of array

[edit | edit source]

whos List variables in workspace, with sizes and types

[edit | edit source]

Data Type Conversion

[edit | edit source]

char Character array

[edit | edit source]

cellstr Convert to cell array of character vectors

[edit | edit source]

int2str Convert integers to characters

[edit | edit source]

mat2str Convert matrix to characters

[edit | edit source]

num2str Convert numbers to character array

[edit | edit source]

str2double Convert string to double precision value

[edit | edit source]

str2num Convert character array to numeric array

[edit | edit source]

native2unicode Convert numeric bytes to Unicode character representation

[edit | edit source]

unicode2native Convert Unicode character representation to numeric bytes

[edit | edit source]

base2dec Convert text representing number in base N to decimal number

[edit | edit source]

bin2dec Convert text representation of binary number to decimal number

[edit | edit source]

dec2base Convert decimal number to character vector representing base N number

[edit | edit source]

dec2bin Convert decimal number to character vector representing binary number

[edit | edit source]

dec2hex Convert decimal number to character vector representing hexadecimal number

[edit | edit source]

hex2dec Convert text representation of hexadecimal number to decimal number

[edit | edit source]

hex2num Convert IEEE hexadecimal string to double-precision number

[edit | edit source]

num2hex Convert singles and doubles to IEEE hexadecimal strings

[edit | edit source]

table2array Convert table to homogeneous array

[edit | edit source]

table2cell Convert table to cell array

[edit | edit source]

table2struct Convert table to structure array

[edit | edit source]

array2table Convert homogeneous array to table

[edit | edit source]

cell2table Convert cell array to table

[edit | edit source]

struct2table Convert structure array to table

[edit | edit source]

cell2mat Convert cell array to ordinary array of the underlying data type

[edit | edit source]

cell2struct Convert cell array to structure array

[edit | edit source]

mat2cell Convert array to cell array with potentially different sized cells

[edit | edit source]

num2cell Convert array to cell array with consistently sized cells

[edit | edit source]

struct2cell Convert structure to cell array

[edit | edit source]