all() 相當(dāng)于與操作,只要有0,就返回0
我們提供的服務(wù)有:成都網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)、微信公眾號(hào)開(kāi)發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、前郭ssl等。為上千余家企事業(yè)單位解決了網(wǎng)站和推廣的問(wèn)題。提供周到的售前咨詢(xún)和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的前郭網(wǎng)站制作公司C = union(A,B):
C為A和B的并集。去掉相同元素。
C = intersect(A,B)
C為A和B的交集. The values of C are in sorted order.
[Lia,Locb] = ismember(A,B):
判斷A中元素是否為B中的子元素,如果不是則,Lia和Locb中元素值都為0(注意,Lia大小和A一樣,Locb大小和B一樣)。如果A中有元素是B中的,在Lia中對(duì)應(yīng)返回值1,Locb, containing the highest index in B for each value in A that is a member of B. The output array, Locb, contains 0 wherever A is not a member of B.
[C,ia] = setdiff(A,B):
返回的C元素為在A中出現(xiàn),但是沒(méi)有在B中出現(xiàn),ia為其索引值,滿(mǎn)足C = A(ia)。
D = D(:)'; % ensure that D is a row vector
D(:)按列將矩陣變?yōu)榱邢蛄?/p>
reshape是根據(jù)原來(lái)的矩陣創(chuàng)造新的矩陣,repmat是將原來(lái)的矩陣復(fù)制多次,構(gòu)成一個(gè)大矩陣。
>> A=magic(4)
A =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
B = reshape(A,...,[],...) calculates the length of the dimension represented by the placeholder [], such that the product of the dimensions equals prod(size(A)). The value of prod(size(A)) must be evenly divisible by the product of the specified dimensions. You can use only one occurrence of [].
>> reshape(A,[],2)
ans =
16 3
5 10
9 6
4 15
2 13
11 8
7 12
14 1
max(a),若a為向量,返回大值,若a為矩陣,返回每列大值作為一個(gè)向量。
C = max(A,B) returns an array the same size as A and B with the largest elements taken from A or B. The dimensions of A and B must match, or they may be scalar.
C = max(A,[],dim) returnsthe largest elements along the dimension of A specifiedby scalar dim. For example, max(A,[],1) producesthe maximum values along the first dimension of A.
[C,I] = max(...) finds the indices of the maximum values of A, and returns them in output vector I. If there are several identical maximum values, the index of the first one found is returned.
K>> c=magic(4)
c =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
K>> max(c) 等同于max(c,[],1)
ans =
16 14 15 13
K>> max(c,[],2)
ans =
16
11
12
15
K>> [m,n]=max(c,[],2)
m =
16
11
12
15
n =
1
2
4
3
find; sparse;full
[i,j,s] = find(S);
[m,n] = size(S);
S = sparse(i,j,s,m,n);
對(duì)于稀疏矩陣,i,j分別是不為零項(xiàng)的index,s是其值
So does this, if the last row and column have nonzero entries:
[i,j,s] = find(S);
S = sparse(i,j,s);
標(biāo)題名稱(chēng):Matlab函數(shù)-創(chuàng)新互聯(lián)
瀏覽路徑:http://redsoil1982.com.cn/article24/dissje.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計(jì)、網(wǎng)站策劃、品牌網(wǎng)站設(shè)計(jì)、網(wǎng)站導(dǎo)航、建站公司、網(wǎng)站維護(hù)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容