Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8417339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:00:54+00:00 2026-06-10T02:00:54+00:00

For a module I’m working on, I’ve received a compiled Matlab executable (Note it’s

  • 0

For a module I’m working on, I’ve received a compiled Matlab executable (Note it’s a stand alone .exe, not a .dll or something along those lines) which I have to execute to do some analysis work for me.

The workflow is that to create an input file (plain simple .csv format), execute the .exe and parse the output file (also .csv) that is generated by the Matlab executable.

I’ve got the input file generation and output file parsing under test and they work beautifully, if I say so myself. But I’m having some trouble with running the Matlab executable. I have the correct MCR installed and I can double click the executable and it runs just as expected. But using the following code, the executable just doesn’t execute properly:

    var analyzer = new Process
    {
        StartInfo =
        {
            FileName = Path.Combine(WorkDirectory, "analyzer.exe"),
            CreateNoWindow = false,
            WindowStyle = ProcessWindowStyle.Hidden,
            UseShellExecute = false, RedirectStandardError = true, RedirectStandardOutput = true // These lines were added for debugging purposes
        }
    };
    analyzer.Start();
    punProcess.WaitForExit();
    string debuginfo = punProcess.StandardOutput.ReadToEnd();
    string debuginfo2 = punProcess.StandardError.ReadToEnd();

The text I pull from “debuginfo” is as follows:

     {Warning: Name is nonexistent or not a directory: C:\MATLAB\R2009b\toolbox\pun.} 
     {> In path at 110
        In addpath at 87
        In startup at 1} 
     {Warning: Name is nonexistent or not a directory:
     C:\MATLAB\R2009b\toolbox\pun\pun.} 
     {> In path at 110
        In addpath at 87
        In startup at 2} 

The text I pulled from “debuginfo2” is:

     {Error using textscan
     Invalid file identifier.  Use fopen to generate a valid file identifier.

     Error in readin (line 4)

     Error in Analyzer (line 12)

     } 
     MATLAB:FileIO:InvalidFid

Are these problems due to my code? Are they due to the context in using it via C#? Or might there be a problem with the analyzer itself? I do not have access to the source of the analyzer executable, so I cannot debug that part.

The error that occurs, could that be because of the warnings given and that I miss some kind of reference (to the MCR maybe?) that is implicitly available when I would just double click it (or run it from cmd, also works like a charm)?

The workdirectory checks out. I’ve can see the input file being created there by prior C# code, as well as the executable being copied there. So the problem is not due to mistakes in preparing the correct files at the correct locations.

Cheers,
Xilconic

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:00:56+00:00Added an answer on June 10, 2026 at 2:00 am

    As Dmitriy Reznik commented, specifying the WorkingDirectory of the StartInfo solved the problem I was having. Is should look like this:

    var analyzer = new Process
    {
        StartInfo =
        {
            FileName = Path.Combine(WorkDirectory, "analyzer.exe"),
            WorkingDirectory = WorkDirectory
            CreateNoWindow = false,
            WindowStyle = ProcessWindowStyle.Hidden,
            UseShellExecute = false, RedirectStandardError = true, RedirectStandardOutput = true // These lines were added for debugging purposes
        }
    };
    analyzer.Start();
    punProcess.WaitForExit();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My module contains some non java files along the java source files. When the
Module M Class C end end What I need is something like: M.was_defined_here?(M::C) M.classes.include?(M::C)
Module Module1 Public Declare Function GET_CALCULATION_FAN_ALONE Lib EbmPapstFan.dll (ByRef path As String) As Long
Module: ./FOO/BAR/Foobar.pm use strict; use warnings; package Foobar; our($VERSION , @ISA , @EXPORT ,
Module Module1 Public cccounter = 9 End Module Public Class frmNim Private Sub btnSelect_Click(sender
module Test def self.model_method puts this is a module method end end class A
plotting module def plotGraph(X,Y): fignum = random.randint(0,sys.maxint) plt.figure(fignum) ### Plotting arrangements ### return fignum
Three module exists. Cfg, Main and Component Cfg.py value = 0 Component.py import Cfg
A module can be unloaded, so how can I tell for sure if it
this module does a good job at creating a tagcloud block - all good

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.