is there any simple code for this to solve larger matrices?
1 次查看(过去 30 天)
显示 更早的评论
function b =check(Q)
Qmd2(1,1)=Q(1);
Qmd2(2,1)=Q(2);
Qmd2(3,1)=Q(3);
Qmd2(1,2)=Q(4);
Qmd2(2,2)=Q(5);
Qmd2(3,2)=Q(6);
disp(Qmd2);
c=[1 2;1 3;1 4];
b=c.*Qmd2;
disp(b);
2 个评论
Jan
2017-3-14
@Aimen: Please explain what you want to achieve. How will c look like if the input has 8 elements?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!