Open nilshg opened 5 years ago
Hi! Thanks so much for letting me know about this. It's tricky to know whether something is a function or a matrix in MATLAB. The script tries to guess, using a list of common functions and using functions that it sees are defined in the block of code being translated. If the translator misses something, names of functions can be added to the "interpret as functions" list in the advanced options below the translator.
I definitely don't recommend translating code and running it as is. The translator is meant to be a time-saver, but still requires learning Julia, manually correcting the translated code, and actually optimizing the code once it is translated.
That said, the translator does not currently recognize some functions that don't return anything (second option in the answer here: https://stackoverflow.com/questions/12992619/can-a-function-be-created-in-matlab-that-returns-nothing )—I'll look into fixing that!
Thanks again!
Sure, do understand that - I don't think there's necessarily a solution here apart from maybe mentioning this prominently somewhere, as this is probably a reasonably common problem!
I added support for functions that don't return anything. Assuming all the code is pasted in together, the
Leaving this open (?) since this is a problem that cannot really solved, but can be gradually improved upon. Any ideas or pull requests to make things better are absolutely welcome. (I'm opening a related issue on mapping common MATLAB functions and packages to Julia.)
MATLAB:
my_function(arg1, arg2)
Julia:my_function[arg1, arg2]
Came across this bug from a user report on: https://discourse.julialang.org/t/methoderror-no-method-matching-getindex/22496/3