merging the values
3 次查看(过去 30 天)
显示 更早的评论
I have 2 matrices
A and B and 100 rows and 42 columns,now i want 1st row of A and B matrices to be stored in an variable named firstcombination,2nd row of A and b matrices to be stored as secondcombination and so on,please help
1 个评论
Walter Roberson
2012-1-30
Do you need to _store_ the combinations one by one in to individual variables each of which includes the combination number? Or do you need to _output_ the combinations to the display?
采纳的回答
Andrei Bobrov
2012-1-30
try this is code:
combinations = permute(cat(3,A,B),[3 2 1]);
your 1st combination:
combinations(:,:,1)
your 2nd combination:
combinations(:,:,2)
ets
更多回答(1 个)
Walter Roberson
2012-1-29
2 个评论
Walter Roberson
2012-1-30
Variable names cannot start with a number. If your requirement is variable names that start with a number, you will need to find a very different computer language.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Performance and Memory 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!