Skip to content

Better anticipate Matlabs behavior regarding integer vs float values? #211

Description

@Naikless

This took me a while to figure out:

If I send data from Julia to Matlab, integer values from Julia will be cast as the corresponding integer values in Matlab. However, using Integer values in Matlab is relatively rare as per default everything is a double.

This can lead to some unexpected errors, because Matlab e.g. refuses to compute something like this:

[int64(1) int64(2)] .* [2,3]
Error using  .* 
Integers can only be combined with integers of the same class, or scalar doubles.

Not sure what the best solution here would be though. At the very least I would stress in the readme that every Julia variable that is supposed to be used by Matlab should be defined as a float, i.e. 1.0 instead of 1 unless the Matlab code specifically asks for integers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions