Why the rows are the first dimension of array by design?
Mostrar comentarios más antiguos
I know it's impossible to change now because of the compatibility burden. But why did the first developers decided to use rows as the first dimension? Isn't it quite weird?
When we type text, we fill all columns before we enter the next row - the first dimension is columns. When an image is written into the disk, the columns of the first row is written before that of the next row - the first dimension is still columns. Even when we code a literal matrix in MATLAB, we start by typing all the columns of the first row:
A=[1 2 3
4 5 6
7 8 9];
Now when we read an image file whose format is not yet supported by imread(), we usually use low-level fread(). However, since image files are usually written row-by-row, we have to transpose the array read, before imshow().
I just can't find a scene where it is more convenient to put rows at the first dimension. I hope if anyone familiar with the history of MATLAB can tell me how did things become like this.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre MATLAB Coder en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!