-
Notifications
You must be signed in to change notification settings - Fork 23
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
Evaluating .m file taking string as input #15
Comments
You problem is mostly likely that you are not passing the variable to the function. Try matlab.eval('loadsir(filename)'). The eval command literally evaluates what you submit, so as far as it is concerned, you are trying to call the function without parameters. |
Thanks, that makes sense. I was just blindly copying the example file, without realizing that it wasn't calling for an argument. I'm having trouble with the fact that the argument is a string: I tried all the combination of
Both the function name and the argument have to be strings, which seems to confuse either the wrapper or Matlab, depending on the version... Any idea how to get around that problem? |
2016-05-12 03:46 +0200, Cynthia Gerlein-Safdi [email protected]:
You could either properly escape the single quote characters, or use
I think that the last one is the preferable way. ;) Did it work? Marek |
2016-05-12 10:18 +0200, [email protected]:
This is also what @grahamj1978 pointed out. Thanks! |
Hey, |
2016-05-12 14:13 +0200, Cynthia Gerlein-Safdi [email protected]:
Yes, using matlab.workspace is an alternative way to call MATLAB functions. However, I'm still surprised that the other method (matlab.put('name', Thank you! Marek |
Hello Marek, The loadsir.m file is actually available here: ftp://ftp.scp.byu.edu/pub/software/matlab/loadsir.m. It calls a bunch of other functions that are in that same matlab folder if you want to just try with the whole thing. An example file can be downloaded directly from here: ftp://ftp.scp.byu.edu/data/qscat/1999/sir/queh/SAm/201/a/queh-a-SAm99-201-204.sir.gz. You need to unzip it first, loadsir.m needs a .sir file. The matlab.workspace option worked perfectly by the way, and I was so happy with how easy it was to install the matlab_wrapper. Great job! Let me know if you reproduce the error. Cynthia |
Hi,
I have been trying to use teh matlab_wrapper as an alternative to the Engine, which for some obscure reason, just stopped working on me recently and I just haven't been able to fix it. I'm trying to evaluate a function that takes one input: a filename. Here is what I'm doing:
At which point I get the following error message:
My Matlab function definitely only takes one argument. Does it have something to do with the fact that it's a string...?
The text was updated successfully, but these errors were encountered: