Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 Matlab 中将这两个命令合并为一个?
Temp = diag(diag(A)); X = Temp(:)
就像是
X = diag(diag(A))(:)
不起作用。
如果你真的想,你可以这样做:
X = reshape(diag(diag(A)),[],1)
不过,我不确定您这样做会获得多少收益!