write for loop output as matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
hi all,
can you advise me how to write my for loop output as matrix as below:
board 1 = 3x4matrix
board 2 = 3x4martix
for boardIdx = 1:params.NumPatterns %board number
R = params.RotationMatrices(:, :, boardIdx)';
t = params.TranslationVectors(boardIdx, :)';
worldBoardCoords = bsxfun(@plus, R * wpConvHull, t); %3x5 matrix
worldBoardCoords = worldBoardCoords(:,1:4) %3x4 matrix
end
2 Kommentare
KALYAN ACHARJYA
am 6 Jan. 2021
output=zeros(3,4)
for i=1:3
for j=1:4
output(i,j)=........% Evaluate output
end
end
In most cases, you can avoid the loop (If not necessity), note on it.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements 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!