-
Notifications
You must be signed in to change notification settings - Fork 64
Function handle #221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey @blegat !
In your example this is correct, so you shouldn't do it that way. Instead the correct way to do this is to copy your Julia array to MATLAB using So ideally do something like: mat"""
result = ode45(@(t,y) sum($x)*t, [0,5], 0)
$result_x = result.x
$result_y = result.y
""" this will expand to the following julia code: put_variable(<random_name>, x)
eval_string("result = ode45(@(t,y) sum(<random_name>)*t, [0,5], 0)")
eval_string("<random_name2> = result.x")
eval_string("<random_name3> = result.y")
result_x = get_variable("<random_name2>")
result_y = get_variable("<random_name3>")
eval_string("clear <random_name> <random_name2> <random_name3>") Also note that there is a size limit of 2GB that can be transferred via the MATLAB engine API. Hope this helps :) |
Thanks a lot! |
Is it possible to create a function handle ? I tried the following but it doesn't seem to work
However, the following works
Ideally would need to create a function handle that is accessing a large Julia matrix. So while this seems to do the trick, I'm worried that it's just copying the content of the matrix in the string so that won't be so good with a large matrix
This also does not work as it seems to not be able to represent the function handle in Julia
Is there any way to call a MATLAB function that requires function handles and that would scale for large matrix.
For the context, this is the function I'd like to call https://github.com/alpyurtsever/SketchyCGAL/blob/master/solver/CGAL.m and
Primitive1
,Primitive2
andPrimitive3
are the function handlesThe text was updated successfully, but these errors were encountered: