Octave equivalent to Python’s print

In Python you can use print:

print("foobar")

whereas in Octave you can use disp:

disp("foobar")

You can print numbers using print in Python:

x = 1
print(x)

and also using disp in Octave:

x = 1
disp(x)

Note that you can use multiple argument to print in Python:

x = 1
print("The value of x is", x)

whereas in Octave you need to use disp together with cstrcat:

disp(cstrcat("The value of x is ", num2str(x)))