MATLAB (documentation):
>> double('α')
ans =
945
Octave 4.0.0, Ubuntu 16.04 (documentation):
>> double('α')
ans =
206 177
Why do I get different results?
Note: 'α' is a greek lowercase alpha.
MATLAB vs Octave are mainly used for the same purpose. The main difference is syntax and other features. Matlab consist of specialized toolboxes which are not part of Octave. They are not fully compatible that is code written in Matlab can crush in octave and vice versa.
MATLAB is a matrix laboratory, referred to as language used for technical computations. Octave is programming language used for numerical computations. 2. It was written in C, C++ and Java programming language.
MATLAB is probably a lot more powerful than Octave, and the algorithms run faster, but for most applications, Octave is more than adequate and is, in my opinion' an amazing tool that is completely free, where Octave is completely free.
Octave is mostly compatible with Matlab. Most matlab functions can be made to run with very little change. With careful coding, you can get your code to run without change in Matlab and Octave.
This is because the default encoding in MATLAB is 'US-ASCII'
(can be different depending on Locale settings) while in Octave, it is 'UTF-8'
.
To confirm, here is the result from MATLAB:
>> unicode2native('α', 'UTF-8')
ans =
1×2 uint8 row vector
206 177
You can check your encoding with feature
or slCharacterEncoding()
:
feature('DefaultCharacterSet')
or
slCharacterEncoding()
According to Mathworks, you can change your encoding with:
slCharacterEncoding(encoding)
I didn't have much luck in changing the encoding and getting the same results afterwards. It could be a bug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With