Matrix Operations Using HDL Coder
2 views (last 30 days)
Show older comments
Hi folks,
I understood reading from other questions how matrix operations could be done using HDL Coder, but it is not totally clear to me. I've read the manual, and there it says that matrix is allowed. It seems the restriction is that matrix format is not permitted as an input/output in the design top level. Isn't it? I tested it, and I got a HDL code with a sort of for loop responsible for doing the multiplication. In the matlab code, I implemented a function with vectors as parameters. Then, I concatenated them and executed the direct multiplication. I reassigned the multiplication result to output vectors.
So, the problem of doing it is that it will not be possible to execute any kind of design exploration with this generated module. Is that right? Would it have another drawback?
I'm actually trying to implement a control design using state space representation. So, it involves a lot of matrix multiplication and summation. What would be the best way for doing that? Should I implement the algorithm of matrix multiplication manually then?
Thanks a lot !!
Mateus Silva
2 Comments
Sivakumaran Chandrasekaran
on 13 Jan 2016
HDL coder is for implementing using VLSI Technology, are you developing any application using VLSI?
Answers (2)
Walter Roberson
on 13 Jan 2016
The restriction is only on the I/O level. You can use a Reshape Block to shape the data as vectors, do I/O on the vectors to send them to the device, then inside the device you can reshape them back to whatever you want and proceed with matrix operations that Simulink would be happy to generate code for you.
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!