rbaleksandar
rbaleksandar

Reputation: 9701

How to pass arguments of type matrix to MCC-build Matlab executable in command line?

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):

enter image description here

Let's call it myFunc(s_curr, s_length, s_length_each).

Printing the values to the console of the editor yields:

enter image description here

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

Answers (0)

Related Questions