The filesize function returns the size of a file as a variable or prints it in the command line.
filesize 'filename' s = filesize('filename')
filesize 'filename' displays the size of any file in the command window.
s = filesize('filename') writes the file size of filename to a variable s in the workspace. Output is in bytes.
How big is that cameraman.tif file?
cameraman.tif is 65.24 KB.
Alternatively, write it to a variable, which will be in units of bytes:
s = filesize('cameraman.tif')
s = 65240
This function was written by Chad A. Greene of the University of Texas at Austin, and the Institute for Geophysics (UTIG), April 2016. http://www.chadagreene.com