How to save multiple 3x1 matrixes in one big matrix?
7 views (last 30 days)
Show older comments
I have this code so far
for F = 100:500
A = [2/7, -1.5/6.5, -1/3; 3/7, 2/6.5, -2/3; -6/7, -6/6.5, -2/3];
B = [0; 0; -F];
X = A\B;
end
And I get a 3x1 matrix for X and I was trying to figure out how to save all the values into one big 3x400 matrix but can't figure it out any help would be appreciated.
0 Comments
Accepted Answer
Dave B
on 11 Oct 2021
How about:
f = 100:500;
X = nan(length(f),3);
A = [2/7, -1.5/6.5, -1/3; 3/7, 2/6.5, -2/3; -6/7, -6/6.5, -2/3];
for i = 1:length(f)
F = f(i);
B = [0; 0; -F];
X(i,:) = A\B;
end
X
More Answers (0)
See Also
Categories
Find more on Multidimensional Arrays 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!