跳轉至內容

Julia for MATLAB 使用者/核心語言/語言基礎

來自華夏公益教科書,開放的書籍,開放的世界

語言基礎

[編輯 | 編輯原始碼]

此頁面將 MATLAB 文件的 語言基礎 部分中記錄的 MATLAB 功能對映到等效的 Julia(核心語言和/或包)功能。

另一個有用的資源是 Julia 文件的 與 MATLAB 的顯著差異 部分。

輸入命令

[編輯 | 編輯原始碼]

相關:Julia REPL

ans 最近的答案
[編輯 | 編輯原始碼]

Julia 的 ans 在功能上基本相同,不過請注意,它僅在 REPL 中可用。

clc 清除命令視窗
[編輯 | 編輯原始碼]

Ctrl+L 在 Julia REPL 中幾乎等效,雖然它不會清除歷史記錄;您仍然可以向上滾動以檢視會話歷史記錄。您也可以等效地(在 Linux/Mac 上)在 shell 模式下執行 clear(1) 命令,即 ;+clear.

save 將命令視窗文字儲存到檔案
[編輯 | 編輯原始碼]

似乎沒有等效的 Julia REPL 命令。

format 設定命令視窗輸出顯示格式
[編輯 | 編輯原始碼]

在 Julia REPL 或 IJulia 中沒有用於全域性設定輸出格式的直接等效項。

home 將游標傳送到主頁
[編輯 | 編輯原始碼]

Ctrl+L 在 Julia REPL 中功能等效。

iskeyword 確定輸入是否為 MATLAB 關鍵字
[編輯 | 編輯原始碼]

似乎沒有等效的 Julia 命令,但請參閱 Julia 手冊中的 關鍵字

more 控制命令視窗的分頁輸出
[編輯 | 編輯原始碼]

矩陣和陣列

[編輯 | 編輯原始碼]

請參閱 Julia 手冊中的 多維陣列

zeros 建立全零陣列;ones 建立全一陣列
[編輯 | 編輯原始碼]

Julia 的 zerosones 功能等效。請注意,用於指定結果資料型別的語法不同,例如 Julia: zeros(Int64, 3, 3) 與 MATLAB zeros(3,3, 'int64')

rand 均勻分佈的隨機數
[編輯 | 編輯原始碼]

請參閱 Julia 的 rand

true 邏輯 1(真);false 邏輯 0(假)
[編輯 | 編輯原始碼]
eye 單位矩陣
[編輯 | 編輯原始碼]

在 Julia 中,要構造一個數值單位矩陣,請使用類似 Matrix(1.0I, 3, 3) 的方法。請注意,符號 I 在 Julia 中是特殊的;它不是表示矩陣,而是 UniformScaling 運算子的例項,因此原則上,使用它比使用恰好在對角線上為 1,其他位置為 0 的稠密矩陣更有效。

diag 建立對角矩陣或獲取矩陣的對角元素
[edit | edit source]
blkdiag 從輸入引數構造分塊對角矩陣
[edit | edit source]
cat 沿指定維度連線陣列
[edit | edit source]
horzcat 水平連線陣列
[edit | edit source]

參見 Julia 的 hcat 函式

vertcat 垂直連線陣列
[edit | edit source]
repelem 重複陣列元素的副本
[edit | edit source]
repmat 重複陣列的副本
[edit | edit source]
linspace 生成線性等間距向量
[edit | edit source]
logspace 生成對數等間距向量
[edit | edit source]
freqspace 頻率響應的頻率間距
[edit | edit source]
meshgrid 2-D 和 3-D 網格
[edit | edit source]
ndgrid N-D 空間中的矩形網格
[edit | edit source]
length 最大陣列維度的長度
[edit | edit source]

Julia 有一個 length 函式,但是它對多維陣列的操作方式與 Matlab 的不同。為了獲得與 Matlab 的 length(X) 相同的行為,在 Julia 中使用 maximum(size(X))

size 陣列大小
[edit | edit source]
ndims 陣列維度的數量
[edit | edit source]

在 Julia 中,ndims 類似但並不完全相同。例如,Julia 不忽略單例維度。

numel 陣列元素的數量
[edit | edit source]

在 Julia 中,length 等價。

isscalar 確定輸入是否為標量
[edit | edit source]
isvector 確定輸入是否為向量
[edit | edit source]
ismatrix 確定輸入是否為矩陣
[edit | edit source]
isrow 確定輸入是否為行向量
[edit | edit source]
iscolumn 確定輸入是否為列向量
[edit | edit source]
isempty 確定陣列是否為空
[edit | edit source]
sort 排序陣列元素
[edit | edit source]
sortrows 對矩陣或表格的各行進行排序
[edit | edit source]
issorted 判斷陣列是否已排序
[edit | edit source]
issortedrows 判斷矩陣或表格的各行是否已排序
[edit | edit source]
topkrows 按排序順序排列的前 k 行
[edit | edit source]
flip 翻轉元素的順序
[edit | edit source]
fliplr 將陣列從左翻轉到右
[edit | edit source]
flipud 將陣列從上翻轉到下
[edit | edit source]
rot90 將陣列旋轉 90 度
[edit | edit source]
transpose 轉置向量或矩陣
[edit | edit source]
ctranspose 複共軛轉置
[edit | edit source]
permute 重新排列 N 維陣列的維度
[edit | edit source]
ipermute 反轉 N 維陣列的維度排列
[edit | edit source]
circshift 以迴圈方式移動陣列
[edit | edit source]
shiftdim 移動維度
[edit | edit source]
reshape 改變陣列的形狀
[edit | edit source]
squeeze 刪除單元素維度
[edit | edit source]

Julia 的 dropdims 函式類似,儘管它需要顯式指定單元素維度。

colon 向量建立、陣列下標和 for 迴圈迭代
[edit | edit source]
end 終止程式碼塊,或指示最後一個數組索引
[edit | edit source]

Julia 的 end 在本質上是等效的。

ind2sub 從線性索引獲取下標
[edit | edit source]
sub2ind 將下標轉換為線性索引
[edit | edit source]

運算子和基本運算

[edit | edit source]

請參閱 Julia 手冊中的 數學運算和基本函式

算術

[edit | edit source]
uplus 一元加法
[edit | edit source]
uminus 一元減號
[編輯 | 編輯原始碼]
times 元素級乘法
[編輯 | 編輯原始碼]
rdivide 右陣列除法
[編輯 | 編輯原始碼]
ldivide 左陣列除法
[編輯 | 編輯原始碼]
power 元素級冪
[編輯 | 編輯原始碼]
mtimes 矩陣乘法
[編輯 | 編輯原始碼]
mrdivide 求解線性方程組 xA = B 的 x
[編輯 | 編輯原始碼]
mldivide 求解線性方程組 Ax = B 的 x
[編輯 | 編輯原始碼]
diff 差分和近似導數
[編輯 | 編輯原始碼]
prod 陣列元素的乘積
[編輯 | 編輯原始碼]
sum 陣列元素的和
[編輯 | 編輯原始碼]
ceil 向正無窮大取整
[編輯 | 編輯原始碼]
fix 向零取整
[編輯 | 編輯原始碼]
floor 向負無窮大取整
[編輯 | 編輯原始碼]
idivide 帶取整選項的整數除法
[編輯 | 編輯原始碼]
mod 除法後的餘數(模運算)
[編輯 | 編輯原始碼]
rem 除法後的餘數
[編輯 | 編輯原始碼]
round 四捨五入到最接近的十進位制數或整數
[編輯 | 編輯原始碼]
bsxfun 對兩個啟用隱式擴充套件的陣列執行逐元素操作
[edit | edit source]

關係運算

[edit | edit source]
eq 判斷相等性
[edit | edit source]
ge 判斷大於或等於
[edit | edit source]
gt 判斷大於
[edit | edit source]
le 判斷小於或等於
[edit | edit source]
lt 判斷小於
[edit | edit source]
ne 判斷不等性
[edit | edit source]
isequal 判斷陣列相等性
[edit | edit source]
isequaln 判斷陣列相等性,將NaN值視為相等
[edit | edit source]

邏輯運算

[edit | edit source]

邏輯運算子:短路邏輯運算,帶短路功能

[edit | edit source]
and 查詢邏輯與
[edit | edit source]
not 查詢邏輯非
[edit | edit source]
or 查詢邏輯或
[edit | edit source]
xor 查詢邏輯異或
[edit | edit source]
all 判斷所有陣列元素是否非零或為真
[edit | edit source]
any 判斷陣列元素中是否存在非零元素
[edit | edit source]
false 邏輯0(false)
[edit | edit source]
find 查詢非零元素的索引和值
[edit | edit source]

在Julia中,findall 提供類似的功能。 也可以參考 findfirst, findlast, findnextfindprev

islogical 判斷輸入是否為邏輯陣列
[edit | edit source]
logical 將數值轉換為邏輯值
[edit | edit source]
true 邏輯 1 (true)
[edit | edit source]

集合操作

[edit | edit source]

intersect 兩個陣列的交集

[edit | edit source]

ismember 陣列元素是集合陣列的成員

[edit | edit source]

ismembertol 在容差範圍內集合的成員

[edit | edit source]

issorted 判斷陣列是否已排序

[edit | edit source]

setdiff 兩個陣列的差集

[edit | edit source]

setxor 兩個陣列的異或

[edit | edit source]

union 兩個陣列的並集

[edit | edit source]

unique 陣列中的唯一值

[edit | edit source]

uniquetol 在容差範圍內唯一值

[edit | edit source]

join 使用關鍵變數按行合併兩個表或時間表

[edit | edit source]

innerjoin 兩個表或時間表之間的內連線

[edit | edit source]

outerjoin 兩個表或時間表之間的外連線

[edit | edit source]

按位運算

[edit | edit source]

bitand 按位與

[edit | edit source]

bitcmp 按位取反

[edit | edit source]

bitget 獲取指定位置的位

[edit | edit source]

bitor 按位或

[edit | edit source]

bitset 設定特定位置的位

[edit | edit source]

bitshift 將位移位指定的位數

[edit | edit source]

bitxor 按位異或

[edit | edit source]

swapbytes 交換位元組順序

[edit | edit source]

資料型別

[edit | edit source]

參見 Julia 手冊中的 型別

數值型別

[edit | edit source]

double 雙精度陣列

[edit | edit source]

single 單精度陣列

[edit | edit source]

int8 8 位有符號整數陣列

[edit | edit source]

int16 16 位有符號整數陣列

[edit | edit source]

int32 32 位有符號整數陣列

[edit | edit source]

int64 64 位有符號整數陣列

[edit | edit source]

uint8 8 位無符號整數陣列

[edit | edit source]

uint16 16 位無符號整數陣列

[edit | edit source]

uint32 32 位無符號整數陣列

[edit | edit source]

uint64 64 位無符號整數陣列

[edit | edit source]

cast 將變數轉換為不同的資料型別

[edit | edit source]

typecast 轉換資料型別,但不改變底層資料

[edit | edit source]

isinteger 判斷輸入是否為整數陣列

[edit | edit source]

isfloat 判斷輸入是否為浮點陣列

[edit | edit source]

isnumeric 判斷輸入是否為數值陣列

[edit | edit source]

isreal 判斷陣列是否為實數

[edit | edit source]

isfinite 陣列中有限的元素

[edit | edit source]

isinf 陣列中無窮大的元素

[edit | edit source]

isnan 陣列中為 NaN 的元素

[edit | edit source]

eps 浮點相對精度

[edit | edit source]

flintmax 浮點格式中最大的連續整數

[edit | edit source]

Inf 無窮大

[edit | edit source]

intmax 指定整數型別的最大值

[edit | edit source]

intmin 指定整數型別的最小值

[edit | edit source]

NaN 非數字

[edit | edit source]

realmax 最大的正浮點數

[edit | edit source]

realmin 最小的正規格化浮點數

[edit | edit source]

字元和字串

[edit | edit source]

string 字串陣列

[edit | edit source]

strings 建立沒有字元的字串陣列

[edit | edit source]

join 合併字串

[edit | edit source]

char 字元陣列

[edit | edit source]

cellstr 轉換為字元向量元胞陣列

[edit | edit source]

blanks 建立空白字元陣列

[edit | edit source]

newline 建立換行符

[edit | edit source]

compose 將資料轉換為格式化的字串陣列

[edit | edit source]

sprintf 將資料格式化為字串

[edit | edit source]

strcat 水平連線字串

[編輯 | 編輯原始碼]

cOnverTcHarstostrings 將字元陣列轉換為字串陣列,保持其他陣列不變

[編輯 | 編輯原始碼]

cOnvertsTrIngstoChars 將字串陣列轉換為字元陣列,保持其他陣列不變

[編輯 | 編輯原始碼]

ischar 判斷輸入是否為字元陣列

[編輯 | 編輯原始碼]

iscellstr 判斷輸入是否為字元向量單元格陣列

[編輯 | 編輯原始碼]

isstring 判斷輸入是否為字串陣列

[編輯 | 編輯原始碼]

isStringScalar 判斷輸入是否為只有一個元素的字串陣列

[編輯 | 編輯原始碼]

strlength 字串陣列中字串的長度

[編輯 | 編輯原始碼]

isstrprop 判斷字串是否屬於指定類別

[編輯 | 編輯原始碼]

isletter 判斷哪些字元是字母

[編輯 | 編輯原始碼]

isspace 判斷哪些字元是空格字元

[編輯 | 編輯原始碼]

contains 判斷模式是否在字串中

[編輯 | 編輯原始碼]

count 統計模式在字串中的出現次數

[編輯 | 編輯原始碼]

endsWith 判斷字串是否以模式結尾

[編輯 | 編輯原始碼]

StartsWith 判斷字串是否以模式開頭

[編輯 | 編輯原始碼]

strfind 在另一個字串中查詢一個字串

[編輯 | 編輯原始碼]

sscanf 從字串中讀取格式化資料

[編輯 | 編輯原始碼]

replace 在字串陣列中查詢並替換子字串

[編輯 | 編輯原始碼]

rEplacebetween 替換由指示其開始和結束的指示符標識的子字串

[編輯 | 編輯原始碼]

strrep 查詢並替換子字串

[編輯 | 編輯原始碼]

join 合併字串

[編輯 | 編輯原始碼]

split 拆分字串陣列中的字串

[編輯 | 編輯原始碼]

splitlines 在換行符處分割字串

[編輯 | 編輯原始碼]

strjoin 連線陣列中的文字

[編輯 | 編輯原始碼]

strsplit 在指定分隔符處分割字串

[編輯 | 編輯原始碼]

strtok 選擇字串的部分

[編輯 | 編輯原始碼]

erase 刪除字串內的子字串

[編輯 | 編輯原始碼]

erasebetween 刪除標記子字串開始和結束的指示符之間的子字串

[編輯 | 編輯原始碼]

eXtractAfter 提取指定位置後的子字串

[編輯 | 編輯原始碼]

eXtractBefore 提取指定位置前的子字串

[編輯 | 編輯原始碼]

eXtractbetween 提取標記子字串開始和結束的指示符之間的子字串

[編輯 | 編輯原始碼]

InsertAfter 在指定子字串後插入字串

[編輯 | 編輯原始碼]

InsertBefore 在指定子字串前插入字串

[編輯 | 編輯原始碼]

pad 向字串新增前導或尾隨字元

[編輯 | 編輯原始碼]

strip 從字串中刪除前導和尾隨字元

[編輯 | 編輯原始碼]

lower 將字串轉換為小寫

[編輯 | 編輯原始碼]

upper 將字串轉換為大寫

[編輯 | 編輯原始碼]

reverse 反轉字串中字元的順序

[編輯 | 編輯原始碼]

deblank 從字串或字元陣列的末尾刪除尾隨空格

[編輯 | 編輯原始碼]

strtrim 從字串陣列或字元陣列中刪除前導和尾隨空格

[編輯 | 編輯原始碼]

strjust 對齊字串或字元陣列

[edit | edit source]

strcmp 比較字串

[edit | edit source]

strcmpi 比較字串(不區分大小寫)

[edit | edit source]

strncmp 比較字串的前 n 個字元(區分大小寫)

[edit | edit source]

strncmpi 比較字串的前 n 個字元(不區分大小寫)

[edit | edit source]

regexp 匹配正則表示式(區分大小寫)

[edit | edit source]

regexpi 匹配正則表示式(不區分大小寫)

[edit | edit source]

regexprep 使用正則表示式替換文字

[edit | edit source]

regexptranslate 將文字翻譯成正則表示式

[edit | edit source]

日期和時間

[edit | edit source]

datetime 代表時間的陣列

[edit | edit source]

NaT 非時間

[edit | edit source]

years 年份的持續時間

[edit | edit source]

days 天數的持續時間

[edit | edit source]

hours 小時的持續時間

[edit | edit source]

minutes 分鐘的持續時間

[edit | edit source]

seconds 秒的持續時間

[edit | edit source]

milliseconds 毫秒的持續時間

[edit | edit source]

duration 固定長度單位的時間長度

[edit | edit source]

calyears 日曆年份的持續時間

[edit | edit source]

calquarters 日曆季度的持續時間

[編輯 | 編輯原始碼]

calmonths 日曆時間以月為單位

[編輯 | 編輯原始碼]

calweeks 日曆時間以周為單位

[編輯 | 編輯原始碼]

caldays 日曆時間以天為單位

[編輯 | 編輯原始碼]

caLendarduration 可變長度日曆單位的時間長度

[編輯 | 編輯原始碼]

month 月份序號和名稱

[編輯 | 編輯原始碼]

day 天數或名稱

[編輯 | 編輯原始碼]

ymd datetime 的年份、月份和日期

[編輯 | 編輯原始碼]

hms 時間段的小時、分鐘和秒

[編輯 | 編輯原始碼]

split 將日曆時間拆分為數字和時間單位

[編輯 | 編輯原始碼]

time 將日曆時間轉換為時間段

[編輯 | 編輯原始碼]

timeofday datetime 的自午夜經過的時間

[編輯 | 編輯原始碼]

isdatetime 判斷輸入是否為 datetime 陣列

[編輯 | 編輯原始碼]

isduration 判斷輸入是否為時間段陣列

[編輯 | 編輯原始碼]

iscalendarduration 判斷輸入是否為日曆時間陣列

[編輯 | 編輯原始碼]

isnat 判斷 NaT (Not-a-Time) 元素

[編輯 | 編輯原始碼]

isdst 確定夏令時元素

[編輯 | 編輯原始碼]

isweekend 確定週末元素

[編輯 | 編輯原始碼]

tzoffset 時區相對於 UTC 的偏移量

[編輯 | 編輯原始碼]

between 日曆數學差

[編輯 | 編輯原始碼]

caldiff 日曆數學連續差

[編輯 | 編輯原始碼]

dateshift 調整日期或生成日期和時間序列

[編輯 | 編輯原始碼]

isbetween 確定日期和時間間隔內的元素

[編輯 | 編輯原始碼]

datenum 將日期和時間轉換為序列日期號

[編輯 | 編輯原始碼]

datevec 將日期和時間轉換為元件向量

[編輯 | 編輯原始碼]

exceltime 將 MATLAB 日期時間轉換為 Excel 日期號

[編輯 | 編輯原始碼]

juliandate 將 MATLAB 日期時間轉換為儒略日

[編輯 | 編輯原始碼]

posixtime 將 MATLAB 日期時間轉換為 POSIX 時間

[編輯 | 編輯原始碼]

yyyymmdd 將 MATLAB 日期時間轉換為 YYYYMMDD 數字值

[編輯 | 編輯原始碼]

addtodate 按欄位修改日期號

[編輯 | 編輯原始碼]

char 字元陣列

[編輯 | 編輯原始碼]

string 字串陣列

[編輯 | 編輯原始碼]

datestr 將日期和時間轉換為字串格式

[編輯 | 編輯原始碼]

now 當前日期和時間作為序列日期號

[編輯 | 編輯原始碼]

clock 當前日期和時間作為日期向量

[編輯 | 編輯原始碼]

date 當前日期字串

[編輯 | 編輯原始碼]

calendar 指定月份的日曆

[編輯 | 編輯原始碼]

eomday 月份的最後一天

[編輯 | 編輯原始碼]

etime 日期向量之間經過的時間

[編輯 | 編輯原始碼]

分類陣列

[編輯 | 編輯原始碼]

categorical 包含分配給類別的值的陣列

[編輯 | 編輯原始碼]

iscategorical 確定輸入是否為分類陣列

[編輯 | 編輯原始碼]

discretize 將資料分組到箱子或類別中

[編輯 | 編輯原始碼]

categories 分類陣列的類別

[編輯 | 編輯原始碼]

iscategory 測試分類陣列類別

[編輯 | 編輯原始碼]

isordinal 確定輸入是否為有序分類陣列

[編輯 | 編輯原始碼]

isprotected 確定分類陣列的類別是否受保護

[編輯 | 編輯原始碼]

addcats 向分類陣列新增類別

[編輯 | 編輯原始碼]

mergecats 合併分類陣列中的類別

[編輯 | 編輯原始碼]

removecats 從分類陣列中刪除類別

[編輯 | 編輯原始碼]

renamecats 重新命名分類陣列中的類別

[編輯 | 編輯原始碼]

reordercats 重新排列分類陣列中的類別

[編輯 | 編輯原始碼]

setcats 設定分類陣列中的類別

[編輯 | 編輯原始碼]

summary 打印表格、時間表或分類陣列的摘要

[編輯 | 編輯原始碼]

countcats 按類別計算分類陣列元素的出現次數

[編輯 | 編輯原始碼]

isundefined 查詢分類陣列中的未定義元素

[編輯 | 編輯原始碼]

table 具有命名變數的表格陣列,這些變數可以包含不同的型別

[編輯 | 編輯原始碼]

array2table 將同質陣列轉換為表格

[編輯 | 編輯原始碼]

cell2table 將元胞陣列轉換為表格

[編輯 | 編輯原始碼]

struct2table 將結構陣列轉換為表格

[編輯 | 編輯原始碼]

table2array 將表格轉換為同質陣列

[編輯 | 編輯原始碼]

table2cell 將表格轉換為元胞陣列

[編輯 | 編輯原始碼]

table2struct 將表格轉換為結構陣列

[編輯 | 編輯原始碼]

table2timetable 將表格轉換為時間表

[編輯 | 編輯原始碼]

timetable2table 將時間表轉換為表格

[編輯 | 編輯原始碼]

readtable 從檔案中建立表格

[編輯 | 編輯原始碼]

writetable 將表格寫入檔案

[編輯 | 編輯原始碼]

DetectImportoptions 基於檔案內容建立匯入選項

[編輯 | 編輯原始碼]

getvaropts 獲取變數匯入選項

[編輯 | 編輯原始碼]

setvaropts 設定變數匯入選項

[編輯 | 編輯原始碼]

setvartype 設定變數資料型別

[編輯 | 編輯原始碼]

head 獲取表格、時間表或高陣列的頂部行

[編輯 | 編輯原始碼]

tail 獲取表格、時間表或高陣列的底部行

[編輯 | 編輯原始碼]

summary 打印表格、時間表或分類陣列的摘要

[編輯 | 編輯原始碼]

height 表格行數

[編輯 | 編輯原始碼]

width 表格變數數

[編輯 | 編輯原始碼]

istable 確定輸入是否為表格

[編輯 | 編輯原始碼]

sortrows 對矩陣或表格的各行進行排序

[編輯 | 編輯原始碼]

unique 陣列中的唯一值

[編輯 | 編輯原始碼]

issortedrows 判斷矩陣或表格的各行是否已排序

[編輯 | 編輯原始碼]

topkrows 按排序順序排列的前 k 行

[編輯 | 編輯原始碼]

addvars 向表格或時間表新增變數

[編輯 | 編輯原始碼]

movevars 移動表格或時間表中的變數

[編輯 | 編輯原始碼]

removevars 從表格或時間表中刪除變數

[編輯 | 編輯原始碼]

splitvars 拆分表格或時間表中的多列變數

[編輯 | 編輯原始碼]

mergevars 將表格或時間表中的變數合併為多列變數

[編輯 | 編輯原始碼]

vartype 透過變數型別索引表格或時間表

[編輯 | 編輯原始碼]

rows2vars 重新排列表格或時間表,使行變為變數

[編輯 | 編輯原始碼]

stack 將多個變數中的資料堆疊到單個變數中

[編輯 | 編輯原始碼]

unstack 將單個變數中的資料解堆疊到多個變數中

[編輯 | 編輯原始碼]

inner2outer 反轉表格或時間表中巢狀的表格層次結構

[編輯 | 編輯原始碼]

join 使用關鍵變數按行合併兩個表或時間表

[編輯 | 編輯原始碼]

innerjoin 兩個表或時間表之間的內連線

[編輯 | 編輯原始碼]

outerjoin 兩個表或時間表之間的外連線

[編輯 | 編輯原始碼]

union 兩個陣列的並集

[編輯 | 編輯原始碼]

intersect 兩個陣列的交集

[編輯 | 編輯原始碼]

ismember 陣列元素是集合陣列的成員

[編輯 | 編輯原始碼]

setdiff 兩個陣列的差集

[編輯 | 編輯原始碼]

setxor 兩個陣列的異或

[編輯 | 編輯原始碼]

ismissing 查詢缺失值

[編輯 | 編輯原始碼]

standArdizemissing 插入標準缺失值

[編輯 | 編輯原始碼]

rmmissing 刪除缺失條目

[編輯 | 編輯原始碼]

varfun 將函式應用於表格或時間表變數

[編輯 | 編輯原始碼]

rowfun 將函式應用於表格或時間表行

[編輯 | 編輯原始碼]

findgroups 查詢組並返回組號

[編輯 | 編輯原始碼]

splitapply 將資料拆分為組並應用函式

[編輯 | 編輯原始碼]

時間表

[編輯 | 編輯原始碼]

timetable 具有時間戳行和不同型別變數的時間表陣列

[編輯 | 編輯原始碼]

retime 對時間表中的資料進行重取樣或聚合,並解決重複或不規則的時間

[編輯 | 編輯原始碼]

synchronize 將時間表同步到公共時間向量,並對輸入時間表中的資料進行重取樣或聚合

[編輯 | 編輯原始碼]

lag 時間偏移時間表中的資料

[編輯 | 編輯原始碼]

table2timetable 將表格轉換為時間表

[編輯 | 編輯原始碼]

array2timetable 將同質陣列轉換為時間表

[編輯 | 編輯原始碼]

timetable2table 將時間表轉換為表格

[編輯 | 編輯原始碼]

istimetable 確定輸入是否為時間表

[編輯 | 編輯原始碼]

isregular 確定時間表中的時間是否為規則

[編輯 | 編輯原始碼]

timerange 時間表行下標的時間範圍

[edit | edit source]

withtol 時間表行下標的時間容差

[edit | edit source]

vartype 透過變數型別索引表格或時間表

[edit | edit source]

rmmissing 刪除缺失條目

[edit | edit source]

issorted 判斷陣列是否已排序

[edit | edit source]

sortrows 對矩陣或表格的各行進行排序

[edit | edit source]

unique 陣列中的唯一值

[edit | edit source]

結構體

[edit | edit source]

struct 結構體陣列

[edit | edit source]

fieldnames 結構體的欄位名,或 COM 或 Java 物件的公共欄位

[edit | edit source]

getfield 結構體陣列的欄位

[edit | edit source]

isfield 確定輸入是否是結構體陣列欄位

[edit | edit source]

isstruct 確定輸入是否是結構體陣列

[edit | edit source]

orderfields 對結構體陣列的欄位進行排序

[edit | edit source]

rmfield 從結構體中刪除欄位

[edit | edit source]

setfield 為結構體陣列欄位賦值

[edit | edit source]

arrayfun 將函式應用於陣列的每個元素

[edit | edit source]

structfun 將函式應用於標量結構的每個欄位

[edit | edit source]

table2struct 將表格轉換為結構陣列

[edit | edit source]

struct2table 將結構陣列轉換為表格

[edit | edit source]

cell2struct 將元胞陣列轉換為結構體陣列

[edit | edit source]

struct2cell 將結構體轉換為元胞陣列

[edit | edit source]

元胞陣列

[edit | edit source]

cell 元胞陣列

[edit | edit source]

cell2mat 將元胞陣列轉換為基礎資料型別的普通陣列

[edit | edit source]

cell2struct 將元胞陣列轉換為結構體陣列

[編輯 | 編輯原始碼]

cell2table 將元胞陣列轉換為表格

[編輯 | 編輯原始碼]

celldisp 顯示元胞陣列內容

[編輯 | 編輯原始碼]

cellfun 對元胞陣列中的每個元胞應用函式

[編輯 | 編輯原始碼]

cellplot 以圖形方式顯示元胞陣列的結構

[編輯 | 編輯原始碼]

cellstr 轉換為字元向量元胞陣列

[編輯 | 編輯原始碼]

iscell 確定輸入是否為元胞陣列

[編輯 | 編輯原始碼]

iscellstr 判斷輸入是否為字元向量單元格陣列

[編輯 | 編輯原始碼]

mat2cell 將陣列轉換為元胞陣列,元胞大小可能不同

[編輯 | 編輯原始碼]

num2cell 將陣列轉換為元胞陣列,元胞大小一致

[編輯 | 編輯原始碼]

strjoin 連線陣列中的文字

[編輯 | 編輯原始碼]

strsplit 在指定分隔符處分割字串

[編輯 | 編輯原始碼]

struct2cell 將結構體轉換為元胞陣列

[編輯 | 編輯原始碼]

table2cell 將表格轉換為元胞陣列

[編輯 | 編輯原始碼]

函式控制代碼

[編輯 | 編輯原始碼]

feval 評估函式

[編輯 | 編輯原始碼]

func2str 從函式控制代碼構建字元向量

[編輯 | 編輯原始碼]

str2func 從字元向量構建函式控制代碼

[編輯 | 編輯原始碼]

localfunctions MATLAB 檔案中所有區域性函式的函式控制代碼

[編輯 | 編輯原始碼]

functions 關於函式控制代碼的資訊

[編輯 | 編輯原始碼]

對映容器

[編輯 | 編輯原始碼]

containers.Map 將值對映到唯一鍵的物件

[編輯 | 編輯原始碼]

isKey 確定 Map 物件是否包含鍵

[編輯 | 編輯原始碼]

keys 返回 Map 物件的鍵

[編輯 | 編輯原始碼]

remove 從 Map 物件中刪除鍵值對

[編輯 | 編輯原始碼]

values 返回 Map 物件的值

[編輯 | 編輯原始碼]

時間序列

[編輯 | 編輯原始碼]

時間序列物件

[編輯 | 編輯原始碼]
timeseries 建立時間序列物件
[編輯 | 編輯原始碼]
addevent 向時間序列新增事件
[編輯 | 編輯原始碼]
addsample 向時間序列物件新增資料樣本
[編輯 | 編輯原始碼]
append 按時間順序連線時間序列物件
[編輯 | 編輯原始碼]
delevent 從時間序列中刪除事件
[編輯 | 編輯原始碼]
delsample 從時間序列物件中刪除樣本
[編輯 | 編輯原始碼]
detrend 從時間序列物件中減去均值或最佳擬合線
[編輯 | 編輯原始碼]
filter 修改時間序列物件的頻率內容
[編輯 | 編輯原始碼]
idealfilter 時間序列理想濾波器
[編輯 | 編輯原始碼]
plot 繪製時間序列
[編輯 | 編輯原始碼]
resample 對時間序列時間向量進行重取樣
[編輯 | 編輯原始碼]
set 設定時間序列屬性
[編輯 | 編輯原始碼]
setabstime 將時間序列時間設定為日期字元向量
[編輯 | 編輯原始碼]
setinterpfunction 為時間序列物件設定預設插值方法
[編輯 | 編輯原始碼]
setuniformtime 修改統一時間序列時間向量
[編輯 | 編輯原始碼]
synchronize 使用公共時間向量同步和重新取樣兩個時間序列物件
[編輯 | 編輯原始碼]
get 查詢時間序列屬性
[編輯 | 編輯原始碼]
getabstime 將時間序列時間向量轉換為單元格陣列
[編輯 | 編輯原始碼]
getdatasamples 訪問時間序列資料樣本
[編輯 | 編輯原始碼]
getdatasamplesize 時間序列資料樣本大小
[編輯 | 編輯原始碼]
getinterpmethod 時間序列插值方法
[編輯 | 編輯原始碼]
getqualitydesc 時間序列資料質量
[編輯 | 編輯原始碼]
getsamples 時間序列的子集
[編輯 | 編輯原始碼]
getsampleusingtime 時間序列資料的子集
[編輯 | 編輯原始碼]
gettsafteratevent 建立在事件或之後的時間序列
[編輯 | 編輯原始碼]
gettsafterevent 建立事件之後的時間序列
[編輯 | 編輯原始碼]
gettsatevent 建立事件發生時的時間序列
[編輯 | 編輯原始碼]
gettsbeforeatevent 建立在事件或之前的時間序列
[編輯 | 編輯原始碼]
gettsbeforeevent 建立事件之前的時間序列
[編輯 | 編輯原始碼]
gettsbetweenevents 建立事件之間的時間序列
[編輯 | 編輯原始碼]
iqr 時間序列資料的四分位距
[編輯 | 編輯原始碼]
max 時間序列資料的最大值
[編輯 | 編輯原始碼]
mean 時間序列資料的平均值
[編輯 | 編輯原始碼]
median 時間序列資料的中間值
[編輯 | 編輯原始碼]
min 時間序列資料的最小值
[編輯 | 編輯原始碼]
std 時間序列資料的標準差
[編輯 | 編輯原始碼]
sum 時間序列資料的總和
[編輯 | 編輯原始碼]
var 時間序列資料的方差
[編輯 | 編輯原始碼]

時間序列集合

[編輯 | 編輯原始碼]
tscollection 建立 tscollection 物件
[編輯 | 編輯原始碼]
addsampletocollection 向 tscollection 新增樣本
[編輯 | 編輯原始碼]
addts 向 tscollection 新增時間序列
[編輯 | 編輯原始碼]
delsamplefromcollection 從 tscollection 刪除樣本
[編輯 | 編輯原始碼]
horzcat 水平連線 tscollection 物件
[編輯 | 編輯原始碼]
removets 從 tscollection 刪除時間序列
[編輯 | 編輯原始碼]
resample 重取樣 tscollection 時間向量
[編輯 | 編輯原始碼]
set 設定 tscollection 屬性
[編輯 | 編輯原始碼]
setabstime 將 tscollection 時間設定為日期字元向量
[編輯 | 編輯原始碼]
settimeseriesnames 重新命名 tscollection 中的時間序列
[編輯 | 編輯原始碼]
vertcat 垂直連線 tscollection 物件
[編輯 | 編輯原始碼]
get 查詢 tscollection 屬性
[編輯 | 編輯原始碼]
getabstime 將 tscollection 時間向量轉換為元胞陣列
[編輯 | 編輯原始碼]
getsampleusingtime tscollection 資料子集
[編輯 | 編輯原始碼]
gettimeseriesnames tscollection 中的時間序列名稱
[編輯 | 編輯原始碼]
isempty 判斷 tscollection 是否為空
[編輯 | 編輯原始碼]
length tscollection 時間向量的長度
[編輯 | 編輯原始碼]
size tscollection 的大小
[編輯 | 編輯原始碼]

時間序列事件

[編輯 | 編輯原始碼]
tsdata.event 建立 tsdata.event 物件
[編輯 | 編輯原始碼]
findEvent 按名稱查詢 tsdata.event
[編輯 | 編輯原始碼]
get 查詢 tsdata.event 屬性
[編輯 | 編輯原始碼]
gEttimeStr 查詢 tsdata.event 時間
[編輯 | 編輯原始碼]
set 設定 tsdata.event 屬性
[編輯 | 編輯原始碼]

資料型別識別

[編輯 | 編輯原始碼]

iscalendarduration 判斷輸入是否為日曆時間陣列

[編輯 | 編輯原始碼]

iscategorical 確定輸入是否為分類陣列

[編輯 | 編輯原始碼]

iscell 確定輸入是否為元胞陣列

[編輯 | 編輯原始碼]

iscellstr 判斷輸入是否為字元向量單元格陣列

[編輯 | 編輯原始碼]

ischar 判斷輸入是否為字元陣列

[編輯 | 編輯原始碼]

isdatetime 判斷輸入是否為 datetime 陣列

[編輯 | 編輯原始碼]

isduration 判斷輸入是否為時間段陣列

[編輯 | 編輯原始碼]

isenum 判斷變數是否為列舉型別

[編輯 | 編輯原始碼]

isfloat 判斷輸入是否為浮點陣列

[編輯 | 編輯原始碼]

isgraphics 對有效的圖形物件控制代碼為真

[編輯 | 編輯原始碼]

isinteger 判斷輸入是否為整數陣列

[編輯 | 編輯原始碼]

isjava 判斷輸入是否為 Java 物件

[編輯 | 編輯原始碼]

islogical 判斷輸入是否為邏輯陣列

[編輯 | 編輯原始碼]

isnumeric 判斷輸入是否為數值陣列

[編輯 | 編輯原始碼]

isobject 判斷輸入是否為 MATLAB 物件

[編輯 | 編輯原始碼]

isreal 判斷陣列是否為實數

[編輯 | 編輯原始碼]

isstring 判斷輸入是否為字串陣列

[編輯 | 編輯原始碼]

isstruct 確定輸入是否是結構體陣列

[編輯 | 編輯原始碼]

istable 確定輸入是否為表格

[編輯 | 編輯原始碼]

istimetable 確定輸入是否為時間表

[編輯 | 編輯原始碼]

is 檢測狀態

[編輯 | 編輯原始碼]

isa 判斷輸入是否為指定類的物件

[編輯 | 編輯原始碼]

class 確定物件的類

[編輯 | 編輯原始碼]

validateattributes 檢查陣列的有效性

[編輯 | 編輯原始碼]

whos 列出工作區中的變數,包括大小和型別

[編輯 | 編輯原始碼]

資料型別轉換

[編輯 | 編輯原始碼]

char 字元陣列

[編輯 | 編輯原始碼]

cellstr 轉換為字元向量元胞陣列

[編輯 | 編輯原始碼]

int2str 將整數轉換為字元

[編輯 | 編輯原始碼]

mat2str 將矩陣轉換為字元

[編輯 | 編輯原始碼]

num2str 將數字轉換為字元陣列

[編輯 | 編輯原始碼]

str2double 將字串轉換為雙精度值

[編輯 | 編輯原始碼]

str2num 將字元陣列轉換為數值陣列

[編輯 | 編輯原始碼]

native2unicode 將數值位元組轉換為 Unicode 字元表示

[編輯 | 編輯原始碼]

unicode2native 將 Unicode 字元表示轉換為數值位元組

[編輯 | 編輯原始碼]

base2dec 將表示 N 進位制數字的文字轉換為十進位制數字

[編輯 | 編輯原始碼]

bin2dec 將二進位制數字的文字表示轉換為十進位制數字

[編輯 | 編輯原始碼]

dec2base 將十進位制數字轉換為表示 N 進位制數字的字元向量

[編輯 | 編輯原始碼]

dec2bin 將十進位制數字轉換為表示二進位制數字的字元向量

[編輯 | 編輯原始碼]

dec2hex 將十進位制數字轉換為表示十六進位制數字的字元向量

[編輯 | 編輯原始碼]

hex2dec 將十六進位制數字的文字表示轉換為十進位制數字

[編輯 | 編輯原始碼]

hex2num 將 IEEE 十六進位制字串轉換為雙精度數字

[編輯 | 編輯原始碼]

num2hex 將單精度和雙精度轉換為 IEEE 十六進位制字串

[編輯 | 編輯原始碼]

table2array 將表格轉換為同質陣列

[編輯 | 編輯原始碼]

table2cell 將表格轉換為元胞陣列

[編輯 | 編輯原始碼]

table2struct 將表格轉換為結構陣列

[編輯 | 編輯原始碼]

array2table 將同質陣列轉換為表格

[編輯 | 編輯原始碼]

cell2table 將元胞陣列轉換為表格

[編輯 | 編輯原始碼]

struct2table 將結構陣列轉換為表格

[編輯 | 編輯原始碼]

cell2mat 將元胞陣列轉換為基礎資料型別的普通陣列

[編輯 | 編輯原始碼]

cell2struct 將元胞陣列轉換為結構體陣列

[編輯 | 編輯原始碼]

mat2cell 將陣列轉換為元胞陣列,元胞大小可能不同

[編輯 | 編輯原始碼]

num2cell 將陣列轉換為元胞陣列,元胞大小一致

[編輯 | 編輯原始碼]

struct2cell 將結構體轉換為元胞陣列

[編輯 | 編輯原始碼]
華夏公益教科書