Multiply matrix (nxm) by vector (m)
古いコメントを表示
Hello,
I need to do a exercise where I have a matrix A of size nxm, a matrix B of size m x p and a column vector x of length m. I am asked to:
a) Write a function "y = MatVecProduct(A, x)" to find y as the product of A and x using this operation:
yi = Summatory from k=1 to m of Aik * xj for all i = 1, ..., n
Then I need to run it on matlab with any vector of dimensions n = 3 and m = 4 and check the operation.
b) Write a function "C = MatMatProduct(A, B)" to find C as the product of A and B using thiis operation:
Cij = Summatory from k=1 to m of Aik * Bkj for all i= 1,...,n and for all j=1,...,p
Then run it on matlab with any matrices of dimensions n=3 and m=p=4.
Thank you in advance.
3 件のコメント
Star Strider
2020 年 10 月 8 日
You have our permission!
Diego Rey
2020 年 10 月 8 日
Steven Lord
2020 年 10 月 8 日
Since this is a homework assignment, if you show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!