looping for a program
1 次查看(过去 30 天)
显示 更早的评论
I have a dataset
X=[12 25 36 47 58 69;34 56 78 90 12 34 ;00 12 89 36 87 56 ]
Y=[89 36 87 56 00 25;25 36 47 87 56 25 ;89 78 45 23 56 99 ]
now i want to add first column of X any Y and store it in separate variables for each column
i have 100 rows
0 个评论
采纳的回答
Andrei Bobrov
2011-11-7
m = size(X,1);
A = reshape(bsxfun(@plus,X(:,1),permute(Y,[3 2 1])),size(X,1),[]);
out = mat2cell(A,size(X,1),ones(size(A,2),1));
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!