Related, but not identical tips for MATLAB.
A little known and little used feature of Octave is that most builtin functions can be called without parentheses, in which case they will treat whatever follows it as a string (as long as it doesn't contain spaces). If it contains spaces you need quotation marks. This can frequently be used to save a byte or two when using disp. All the following work, and gives the same result:
disp('Hello')
disp Hello
disp"Hello"
If you have spaces, then you must have the quotation marks:
disp('Hello, World!')
disp"Hello, World!"
Other, less useful examples include:
nnz PPCG
ans = 4
size PPCG
ans = 1 4
str2num 12
ans = 12
- 46.8k
- 16
- 137
- 304