.net - c# application running matlab error using cd too many input arguments -


i looking run matlab function c# application.

my code below, edited link matlab example previous question on here. code not working.

the error message happens on matlab.feval line. although code looks same example.

an unhandled exception of type 'system.runtime.interopservices.comexception' occurred in mscorlib.dll.  additional information: error using cd many input arguements 

code

static void main(string[] args)     {         // create matlab instance         mlapp.mlapp matlab = new mlapp.mlapp();         matlab.visible = 1;          // change directory function located         matlab.execute(@"cd g:\shared\folder\matlab\non linear");          // define output         object result = null;          // call matlab function upload_data         //matlab.feval("upload_data", 0, out result);         matlab.feval("upload_data_test", 1, out result, "dms", "dsfd", 0);         //[success] = upload_data_test(data_base, str_dir, b_return_data)          // quit matlab         matlab.quit();         releaseobject(matlab);                      // display result         object[] res = result object[];          console.writeline(res[0]);         console.readline();     } 

use:

matlab.execute(@"cd 'g:\shared\folder\matlab\non linear'"); 

note ' character enclose matlab string.

otherwise whitespace character in path split input , cd thinks receiving 2 inputs.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -