How do I load two matrices from a single .mat file?
10 views (last 30 days)
Show older comments
Mohamed Amine Mouajib
on 31 Oct 2019
Commented: Mohamed Amine Mouajib
on 31 Oct 2019
Hi
I have a random file, let's call it rand.mat. This file has two matrices A and B (they're actually called A and B) and each one is 50x50. How do I load each of the two into two separate 50x50 matrices that I can later use in a formula to create a third 50x50 matrix?
0 Comments
Accepted Answer
Walter Roberson
on 31 Oct 2019
file_struct = load('NameOfMat.mat', 'A', 'B');
A = file_struct.A;
B = file_struct.B;
More Answers (0)
See Also
Categories
Find more on Sources in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!