Reputation: 9701
New to Matlab. I am using GNU Octave for the example below but I've checked and it also works in Matlab (in my case R2018a).
I have a function that takes the following parameters as input (workspace view):
Let's call it myFunc(s_curr, s_length, s_length_each)
.
Printing the values to the console of the editor yields:
I through I can just take what's displayed in the workspace view and paste it, e.g.
myFunc.exe [0,1,2,3,4,5;0,0,0,0,0,0] 5 [1,1,1,1,1]
That yields (using PowerShell)
In line:1 character:49
+ .\myFunc.exe [0,1,2,3,4,5;0,0,0,0,0,0] 5 [1,1,1,1,1]
+ ~
Unexpected Token "]" in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken
Then I thought, ok, maybe I need to use quotation marks, e.g.
myFunc.exe "[0,1,2,3,4,5;0,0,0,0,0,0]" 5 "[1,1,1,1,1]"
That results (again PowerShell) in
Error using cumsum
Invalid data type. First input argument must be numeric or logical.
Error in getMidpointOfPoly (line 30)
MATLAB:cumsum:wrongInput
Removing the []
ended up with the same error. For me it's anything but intuitive how to pass arguments to a compiled Matlab application.
Upvotes: 0
Views: 18