how do I flip ever column in a matrix without using the fliplr function?
18 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
RozuSolo
el 18 de Mayo de 2022
Comentada: Image Analyst
el 18 de Mayo de 2022
n = randi([4,15]);
n_mat = randi ( [1,100], n, n)
this generates a matrix, and I want basically do the "fliplr" command with just operations
0 comentarios
Respuesta aceptada
Voss
el 18 de Mayo de 2022
n = randi([4,15]);
n_mat = randi ( [1,100], n, n)
n_mat_flipped = n_mat(:,end:-1:1)
3 comentarios
Image Analyst
el 18 de Mayo de 2022
No. Colon : means "All rows" rather than an entire row. So it's reversing each and every row, putting the last column first, then the next to the last column, and finally on the right edge it will be the original first element in the row. Again that's done for all rows so all columns are flipped left to right..
Más respuestas (0)
Ver también
Categorías
Más información sobre Characters and Strings 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!