Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
MATLAB's LOAD problem in .exe console created from VC++

Subject: MATLAB's LOAD problem in .exe console created from VC++

From: weapon@pacific.net.sg (Kevin Low)

Date: 23 May, 2002 20:48:17

Message: 1 of 7

Hi,

Need a big help here. So far, I have successfully complied m-files
into VC++ files and able to create a running .exe program. However,
in the orginal MATLAB progam, I have a load file function, which works
well in MATLAB but it does not work in the .exe program created by
VC++. I saw the message "Unable to open file" in the DOS windows
which is there when the .exe program runs.

The sequence in MATLAB is as follows:

1. I created a handle with several parameters, e.g. hndlist

2. hndfile = hndlist(6); %which is the text filename to be loaded

3. file = get(hndfile, 'String');

4. data = load(file);

There were no error or warning during the Build or debug session in
VC++. Appreciate if someone can help me on this. Thank you.

Regards,
Kevin

Subject: MATLAB's LOAD problem in .exe console created from VC++

From: Sam W

Date: 28 May, 2002 10:41:39

Message: 2 of 7

I'm having the same problem, and I'm compiling with the Matlab Compiler.


Anyone ???


Thanks

Subject: MATLAB's LOAD problem in .exe console created from VC++

From: Pascal

Date: 29 May, 2002 13:42:03

Message: 3 of 7

I am having the same problem too...

Kevin Low a écrit :

> Hi,
>
> Need a big help here. So far, I have successfully complied m-files
> into VC++ files and able to create a running .exe program. However,
> in the orginal MATLAB progam, I have a load file function, which works
> well in MATLAB but it does not work in the .exe program created by
> VC++. I saw the message "Unable to open file" in the DOS windows
> which is there when the .exe program runs.
>
> The sequence in MATLAB is as follows:
>
> 1. I created a handle with several parameters, e.g. hndlist
>
> 2. hndfile = hndlist(6); %which is the text filename to be loaded
>
> 3. file = get(hndfile, 'String');
>
> 4. data = load(file);
>
> There were no error or warning during the Build or debug session in
> VC++. Appreciate if someone can help me on this. Thank you.
>
> Regards,
> Kevin

Subject: MATLAB's LOAD problem in .exe console created from VC++

From: Monica Berkenpas

Date: 10 Jun, 2002 14:56:46

Message: 4 of 7

The LOAD function does not currently support reading ASCII files when
compiled into a stand-alone application. Currently, only MAT-files
can be read using LOAD in stand-alone applications.


There are a couple of different solutions on our web site that
discuss this issue and some possible work arounds:


Why do I receive an error message when loading an ASCII file in an
M-file compiled with the MATLAB Compiler?
<http://www.mathworks.com/support/solutions/data/24103.shtml>


How do I read an ASCII data file from stand-alone code generated by
the MATLAB Compiler?
<http://www.mathworks.com/support/solutions/data/4346.shtml>


hth.
Monica


Kevin Low wrote:
>
>
> Hi,
>
> Need a big help here. So far, I have successfully complied m-files
> into VC++ files and able to create a running .exe program. However,
> in the orginal MATLAB progam, I have a load file function, which
works
> well in MATLAB but it does not work in the .exe program created by
> VC++. I saw the message "Unable to open file" in the DOS windows
> which is there when the .exe program runs.
>
> The sequence in MATLAB is as follows:
>
> 1. I created a handle with several parameters, e.g. hndlist
>
> 2. hndfile = hndlist(6); %which is the text filename to be loaded
>
> 3. file = get(hndfile, 'String');
>
> 4. data = load(file);
>
> There were no error or warning during the Build or debug session in
> VC++. Appreciate if someone can help me on this. Thank you.
>
> Regards,
> Kevin
>

Subject: MATLAB's LOAD problem in .exe console created from VC++

From: Michael Teo

Date: 29 Mar, 2011 07:48:03

Message: 5 of 7

I have the same problem too. And the 2 links below is no longer valid.
Can you please point me to the correct resources?

"Monica Berkenpas" <monicab@mathworks.com> wrote in message <eeae1ca.2@WebX.raydaftYaTP>...
> The LOAD function does not currently support reading ASCII files when
> compiled into a stand-alone application. Currently, only MAT-files
> can be read using LOAD in stand-alone applications.
>
>
> There are a couple of different solutions on our web site that
> discuss this issue and some possible work arounds:
>
>
> Why do I receive an error message when loading an ASCII file in an
> M-file compiled with the MATLAB Compiler?
> <http://www.mathworks.com/support/solutions/data/24103.shtml>
>
>
> How do I read an ASCII data file from stand-alone code generated by
> the MATLAB Compiler?
> <http://www.mathworks.com/support/solutions/data/4346.shtml>
>
>
> hth.
> Monica

Subject: MATLAB's LOAD problem in .exe console created from VC++

From: Rune Allnor

Date: 29 Mar, 2011 08:24:43

Message: 6 of 7

On Mar 29, 9:48 am, "Michael Teo" <m...@empiricap.com> wrote:
> I have the same problem too.  And the 2 links below is no longer valid.
> Can you please point me to the correct resources?

Forget about matlab and parse the file directly from C++.

Rune

Subject: MATLAB's LOAD problem in .exe console created from VC++

From: Steven_Lord

Date: 29 Mar, 2011 13:41:02

Message: 7 of 7



"Michael Teo" <mteo@empiricap.com> wrote in message
news:ims2rj$iuv$1@fred.mathworks.com...
> I have the same problem too. And the 2 links below is no longer valid.
> Can you please point me to the correct resources?

You resurrected a very old thread here; the URLs for those documents changed
several years ago. Take a look at this document.

http://www.mathworks.com/support/solutions/en/data/1-15QNK/?solution=1-15QNK

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us