freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

matlab的基本使用方法(編輯修改稿)

2025-06-15 18:40 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 5 class(y) ans = int8 各種數(shù)據(jù)類(lèi)型之間的轉(zhuǎn)換 : 2021/6/15 24 不同整數(shù)類(lèi)型之間不能進(jìn)行運(yùn)算 x=int8(5) x = 5 y=int16(23) y = 23 z=x+y ??? Error using == plus Integers can only be bined with integers of the same class, or scalar doubles. 2021/6/15 25 浮點(diǎn)數(shù) ?MATLAB 的默認(rèn)數(shù)據(jù)類(lèi)型是雙精度類(lèi)型( double)。 ?為了節(jié)省存儲(chǔ)空間, MATLAB 也支持單精度數(shù)據(jù)類(lèi)型的數(shù)組。 ?創(chuàng)建單精度類(lèi)型的變量時(shí)需要聲明變量類(lèi)型,與創(chuàng)建整型變量類(lèi)似。 x=single() x = y=34 y = 34 x+y ans = class(x+y) ans = single 單精度數(shù)據(jù)類(lèi)型的數(shù)據(jù)進(jìn)行運(yùn)算時(shí),返回值為單精度。 2021/6/15 26 realmin(‘ single’ ), realmax(39。single39。) ans = ans = +038 eps(39。single39。) ans = realmin(‘double’), realmax(39。double39。) ans = ans = +308 eps(39。double39。) ans = 例 212 單精度和雙精度數(shù)據(jù)類(lèi)型的取值范圍和精度 2021/6/15 27 ? MATLAB的所有運(yùn)算是定義在復(fù)數(shù)域上 . ? MATLAB中虛數(shù)單位用 i或者 j表示 ? 通過(guò)兩種方法創(chuàng)建復(fù)數(shù): 1. 直接輸入法 (不建議大家使用) 2. 通過(guò) plex 函數(shù) 2021/6/15 30 plex 函數(shù)的調(diào)用方法如下。 ? c = plex(a,b): 返回結(jié)果 c 為復(fù)數(shù),其實(shí)部為 a,虛部為 b。輸入?yún)?shù) a 和 b 可以為標(biāo)量,或者維數(shù)、大小相同的向量、矩陣或者多維數(shù)組,輸出參數(shù)和 a 和 b 的結(jié)構(gòu)相同。 ? a 和 b 可以有不同的數(shù)據(jù)類(lèi)型,當(dāng) a 和 b 為各種不同的類(lèi)型時(shí),返回值分別為: ? 當(dāng) a 和 b 中有一個(gè)為單精度時(shí),返回結(jié)果為單精度; ? 如果 a 和 b 其中一個(gè)為整數(shù)類(lèi)型,則另外一個(gè)必須有相同的整數(shù)類(lèi)型,或者為雙精度型,返回結(jié)果 c 為相同的整數(shù)類(lèi)型。 2021/6/15 31 x=int8(2),y=int8(3) x = 2 y = 3 z2=plex(x,y) z2 = 2 + 3i plex()創(chuàng)建單個(gè)復(fù)數(shù) 2021/6/15 32 a=int8([1 2 3 4]) a = 1 2 3 4 b=int8([2 3 4 5]) b = 2 3 4 5 c=plex(a,b) c = 1 + 2i 2 + 3i 3 + 4i 4 + 5i plex()創(chuàng)建復(fù)數(shù)數(shù)組 2021/6/15 33 復(fù)數(shù)直角坐標(biāo)和極坐標(biāo)之間轉(zhuǎn)換 ?real(z): 給出復(fù)數(shù) z的實(shí)部 ?imag(z):給出復(fù)數(shù) z的虛步 ?abs(z):給出 z的模 ?angle(z):以弧度為單位給出復(fù)數(shù) z的幅角 2021/6/15 34 ?c = plex(a),只有一個(gè)輸入?yún)?shù),返回結(jié)果 c 為復(fù)數(shù),其實(shí)部為 a,虛部為 0。但是此時(shí) c 的數(shù)據(jù)類(lèi)型為復(fù)數(shù)。 x=int8(x) x = 2 c=plex(x) c = 2 isreal(c) ans = 0 d=plex(a) d = 1 2 3 4 isreal(d) ans = 0 e=x+0*i e = 2 isreal(e) ans = 1 isreal(x)判斷 x是否為實(shí)數(shù) 2021/6/15 35 1. 邏輯變量的值:邏輯真 (1)、邏輯假 (0) MATLAB 函數(shù)或操作符會(huì)返回邏輯真或邏輯假表示條件是否滿足。 – 例如 :表達(dá)式 (5 * 10) 40 返回邏輯真。 3. 邏輯數(shù)組:數(shù)組的元素全部是邏輯值。 如下面的表達(dá)式返回邏輯數(shù)組: [30 40 50 60 70] 40 ans = 0 0 1 1 1 2021/6/15 36 創(chuàng)建邏輯數(shù)組 1:創(chuàng)建邏輯數(shù)組的最簡(jiǎn)單的方法為直接輸入元素的值為 true 或者 false x=[true,false,true] x = 1 0 1 2:邏輯數(shù)組也可以通過(guò)邏輯表達(dá)式生成 x=[1 2 3 4]2 x = 0 0 1 1 class(x) ans = logical 2021/6/15 37 函數(shù) 說(shuō)明 true, false 將輸入?yún)?shù)轉(zhuǎn)化為邏輯值 logical 將數(shù)值轉(zhuǎn)化為邏輯值 amp。 (and), | (or), ~ (not), xor, any, all 邏輯操作符 amp。amp。, || “并”和“或”的簡(jiǎn)寫(xiě)方式 == (eq), ~= (ne), (lt), (gt), = (le), =
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1