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.
我有一串字母,例如
S = ['a';'b';'c';'d';'e'];
我想把它放在表格的第 3 列:
table(:,1) = M1; table(:,2) = d1; disp(table)
M1并且每个d1都是5 X 1数字矩阵。
M1
d1
5 X 1
您可以考虑这样做:
r = {M1, d1, S};
或者
r = {M1; d1; S};
编辑
你也可以这样做:
M1 = rand(5,1); d1 = rand(5,1); S = ['a';'b';'c';'d';'e']; y = arrayfun(@(i) {M1(i), d1(i), S(i)'},1:5,'UniformOutput',false); res = cat(1,y{:});
我建议这种方法来解决您的问题。