MATLAB: Do i get rid of this error using cumsum saying ‘dimension argument must be positive integer scalar within indexing range
cumsumcumsumerror
I am trying to get the cumulative return of four trading strategies using cum sum and it is giving me the error in the screen shot, how do i get rid of it?
CUMSUM does not work for data that isn't single or double. You can write your own function to do this, or cast the data to single before passing to CUMSUM. Note however, that you will have to figure out what to do with overflow! The cumulative sum in uint8 may easily go over 255.
intmax('uint8')
You could also convert your image to have a datatype which has a larger range...
Best Answer