I have a question on MATLAB Onramp Chapter 5.1 Indexing into Arrays, Task 3:
Under what "real" scenario would I use the "end-1" command to find a value?
In the given example of MATLAB Onramp, the task is to find the value in the 6th row and 3rd column. I understand that I can use the keyword "end" to either find a row or column index to reference of the last element, which is quick and straightforward in a dataset, but why would I use the "end-1" as parameter? Doesn't it make it too complicated to find an "unknown" value?
Any further explanation on this is much appreciated.
Best Answer