Python: Cast int to double
<p>I am practicing calling matlab functions from python
and I am getting this error that I don't seem to understand how to fix.</p>

<p>Problem:
TypeError: unsupported operand type(s) for *=: 'double' and 'int'</p>

<p>This is my code:</p>

<pre><code>import matlab.engine
mat = matlab.engine.start_matlab()

dims = mat.ones(1, 3)
dims *= 5 // here is the problem

print(dims)
</code></pre>

<p>I can assume that <code>ones</code> returns a double and 5 is int
    And this changes my problem to casting the int to double.</p>

<p>I tried using float(5) but then I get this:
TypeError: unsupported operand type(s) for *=: 'double' and 'float'</p>

<p>How do I cast an int to a double in python ?</p>