... <看更多>
「reshape matlab」的推薦目錄:
- 關於reshape matlab 在 Re: [討論] 二維轉一維- 看板MATLAB 的評價
- 關於reshape matlab 在 Matlab vs Python: Reshape - Stack Overflow 的評價
- 關於reshape matlab 在 how to reshape a matrix or vector in matlab - YouTube 的評價
- 關於reshape matlab 在 Index ordering and reshape in NumPy and MATLAB 的評價
- 關於reshape matlab 在 Reshape vectors exactly like in MATLAB - Mathematica Stack ... 的評價
- 關於reshape matlab 在 mcnExtraLayers/Reshape.m at master · albanie ... - GitHub 的評價
reshape matlab 在 Index ordering and reshape in NumPy and MATLAB 的推薦與評價
Index ordering and reshape in NumPy and MATLAB¶. Let's make a 3D array by taking a 1D array from 0 through 23, and filling the 3D array by depth (the last ... ... <看更多>
reshape matlab 在 Reshape vectors exactly like in MATLAB - Mathematica Stack ... 的推薦與評價
Just apply transpose to the top answer: reshape[mtx_, n_, _] := Transpose[Partition[Flatten[mtx], n]];. ... <看更多>
reshape matlab 在 mcnExtraLayers/Reshape.m at master · albanie ... - GitHub 的推薦與評價
mcnExtraLayers/matlab/+dagnn/Reshape.m · Go to file T · Go to line L · Copy path · Copy permalink. ... <看更多>
reshape matlab 在 Re: [討論] 二維轉一維- 看板MATLAB 的推薦與評價
reshape -->可將二維矩陣變一維
numel -->可訂出矩陣size
A=[0 1 3 4;
5 6 1 1;
7 0 1 8;
9 0 0 0;]
B= reshape (A, 1, numel(A)) --> 得到 B=[0 5 7 9 1 6 0 0 3 1 1 0 4 1 8 0]
先轉置在求B比較符合你要的排列
B= reshape (A',1, numel(A)) --> 得到 B=[0 1 3 4 5 6 1 1 7 0 1 8 9 0 0 0]
最後用推文的
B= B(B/2>1) -->為你所求
結論 code:
A=[0 1 3 4;
5 6 1 1;
7 0 1 8;
9 0 0 0;]
B= reshape (A',1, numel(A))
B= B(B/2>1)
※ 引述《Lionel (跟快樂交往)》之銘言:
: 問題:
: A=[0 1 3 4;
: 5 6 1 1;
: 7 0 1 8;
: 9 0 0 0;]
: 如果A矩陣(4*4)的一個元素/2後大於1
: 想要得到結果是B(1*N)矩陣 %N的大小由A決定
: B=[3 4 5 6 7 8 9]
: 該如何寫code
: my code
: A=[0 1 3 4;
: 5 6 1 1;
: 7 0 1 8;
: 9 0 0 0;]
: for i=1:3
: for j=1:4
: if a(i,j)/2>1
: end
: end
: end
: if裡面要放什麼我就想不出來了....
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.255.36.11
※ 文章網址: https://www.ptt.cc/bbs/MATLAB/M.1427036707.A.4EC.html
... <看更多>