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 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Sean Flanagan
am 18 Sep. 2022
Kommentiert: Sean Flanagan
am 19 Sep. 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 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!