How to save multiple 3x1 matrixes in one big matrix?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dylan Velarde
el 11 de Oct. de 2021
Comentada: Dylan Velarde
el 11 de Oct. de 2021
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 comentarios
Respuesta aceptada
Dave B
el 11 de Oct. de 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
Más respuestas (0)
Ver también
Categorías
Más información sobre Multidimensional Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!