table1函式 一維查表

2021-07-09 06:34:53 字數 871 閱讀 5679

【功能介紹】

一維查表

【格式】

格式 y = table1(tab,x0) %返回用**矩陣tab中的行線性插值元素,對x0(tab的第一列查詢x0)進行線性插值得到的結果y。矩陣tab是第一列包含關鍵值,而其他列包含資料的矩陣。x0中的每一元素將相應地返回一線性插值行向量。矩陣tab的第一列必須是單調的。

【例項介紹】

>>tab = [(1:4)' hilb(4)]

>>y = table1(tab,[1 2.3 3.6 4])

查表結果為:

tab =

1.0000 1.0000 0.5000 0.3333 0.2500

2.0000 0.5000 0.3333 0.2500 0.2000

3.0000 0.3333 0.2500 0.2000 0.1667

4.0000 0.2500 0.2000 0.1667 0.1429

warning: table1 is obsolete and will be removed in future versions. use interp1 or interp1q instead.

> in d:\matlabr12\toolbox\matlab\polyfun\table1.m at line 31

y =1.0000 0.5000 0.3333 0.2500

0.4500 0.3083 0.2350 0.1900

0.2833 0.2200 0.1800 0.1524

0.2500 0.2000 0.1667 0.1429

由上面結果可知,table1是一將要廢棄的命令。

Swoole學習筆記 記憶體表table 1

一 個人案例 建立記憶體表物件 table new swoole table 1024 在記憶體表中定義三列 table column id swoole table type int,4 table column name swoole table type string,12 table col...

將二維陣列列印成table的模板函式

template bool printtablehtml const type arr row col const std string htmlfile,const std string tableinfo cout row endl col endl ofstream fout htmlfile...

一維陣列中元素反向 1

print 生成0 19之間的陣列 a 一維陣列反向 a1 a 1 print 將a陣列反向 a1 生成0 19之間的陣列 0 1 2 3 4 5 6 7 將a陣列反向 7 6 5 4 3 2 1 0 高維陣列則沒有反向效果 將陣列轉換為 2,4 將陣列轉換為 4,2 a 2 4 a1.reshap...