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.
例如,我有一个 6x6 矩阵,然后我想取出位于该矩阵中心的小矩阵,比如 2x2。有什么聪明的方法吗?或者我必须遍历旧矩阵,然后将值复制到新矩阵? 非常感谢你。
当然可以。例如尝试
A = rand(6,6); % // big matrix, an example B = A(3:4,3:4); % // central sub matrix obtained using indices
这(在这种情况下)也相当于
B = A([3 4],[3 4]);
通常,您可以从选择您感兴趣的索引的向量中提取子向量。
首先,非常感谢大家一直以来的支持。
我有一个与 .xhtml 和 'f:ajax' 相关的问题。
我通过默认折叠的bean变量设置richfaces:collapsiblepanel'expanded'属性,并且在模糊事件中它被扩展。我想在 f:ajax 请求完成后将焦点设置为 UIComponent。为此,我用