I have two matrices the same size 'F1result' and 'F2result'. I need to compare them element by element and create a new matrices 'F' with whichever value is greater.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Sean Flanagan
el 18 de Sept. de 2022
Comentada: Sean Flanagan
el 19 de Sept. de 2022
[M,N] = size(MagGridForceAX); % Establish dimensions for row and column loop counters
for i = 1:M
for j = 1:N
% Creates coefficients for the simultaneous equations of F1 and F2
% based on sum of x and sum of y forces equalling zero
CoefficientMatrix = [MagGridForceAX(i,j) MagGridForceBX(i,j); MagGridForceAY(i,j) MagGridForceBY(i,j)];
% Forces Matrix solving for forces in beams in each x and y
% coordinate
ForcesMatrix = CoefficientMatrix\P;
F1result(i,j) = ForcesMatrix(1);
F2result(i,j) = ForcesMatrix(2);
end
end
0 comentarios
Respuesta aceptada
Más respuestas (1)
Ver también
Categorías
Más información sobre Get Started with MATLAB 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!