TAGGED: script
-
-
August 23, 2023 at 8:27 am
S1120223150009655
Subscriber各位老师好,请教一下lemerrical中有没有像matlab中的cat一样的函数,可以用于串联元胞数组中的矩阵,以便将元胞数组中每个矩阵(同维)的每个维的值加起来。
matlab中:
-
August 24, 2023 at 7:27 pm
Guilin Sun
Ansys Employee从这个链接看 Concatenate arrays - MATLAB cat (mathworks.com)
相当于把第二个矩阵加到第一个矩阵后面产生新的矩阵。
遗憾,没有。你需要先定义一个新矩阵,大小是两个矩阵长度的和,然后将这两个矩阵分别赋值给新矩阵,比如
A1 长n1; A2 长n2,则需要
A3=matrix(n1+n2);
A3(1:n1)=A1;
A3(n1+1,n1+n2)=A2;
你试一下。高维的也采用类似方法,当然也可以将高维压缩为一维,然后再Reshape。
https://optics.ansys.com/hc/en-us/articles/360034925873-reshape-Script-command
-
Viewing 1 reply thread
- The topic ‘有没有matlab中像cat一样的函数,可以串联元胞数组中的矩阵,以便将元胞数组中每个矩阵’ is closed to new replies.
Ansys Innovation Space
Trending discussions
Top Contributors
-
3442
-
1057
-
1051
-
917
-
896
Top Rated Tags
© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.