Got Questions? Get Answers.
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:
Phantom code appears in diary!

Subject: Phantom code appears in diary!

From: dan berkowitz

Date: 6 Sep, 2010 15:27:06

Message: 1 of 7

Hi,
 I am running a series of m-files and loggin thier execution in a log file using teh diary commend.

Surprisingly, when I open the log file, I keep seeing this code which doesn't appear in any of my m-files!!!

% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);

can someone please help me get rid of this 'phantom' code!!!

Thank you!

db

Subject: Phantom code appears in diary!

From: Sadik

Date: 6 Sep, 2010 16:50:05

Message: 2 of 7

Hi Dan,

Are you using the command "echo on"? If so, you should discard it since, as far as I know, anything that appears in the command window goes into the diary file.

Best.

Subject: Phantom code appears in diary!

From: Sadik

Date: 6 Sep, 2010 17:27:05

Message: 3 of 7

By the way, I have just realized that you are saying it doesn't appear in any of your files. Then you should make sure that you are using the right versions of your files. You might have two files with identical name but in different folders. If one is preceding the other in the matlab path, you might be running the one which you didn't mean to.

How to check that?

You can use the "which" command. It will tell you the full path of the file it is using. If you use the option "all", you can directly see if you have more than one file with the same name. You had better do this check for all of your files that you're running.

Best.

Subject: Phantom code appears in diary!

From: John D'Errico

Date: 6 Sep, 2010 19:36:05

Message: 4 of 7

"dan berkowitz" <aim120c5@gmail.com> wrote in message <i6318a$22k$1@fred.mathworks.com>...
> Hi,
> I am running a series of m-files and loggin thier execution in a log file using teh diary commend.
>
> Surprisingly, when I open the log file, I keep seeing this code which doesn't appear in any of my m-files!!!
>
> % Modify expression to add input arguments.
> % Example:
> % a = [1 2 3; 4 5 6];
> % foo(a);
>
> can someone please help me get rid of this 'phantom' code!!!
>

I would do a search for this code fragment, using a tool like
my mgrep function.

http://www.mathworks.com/matlabcentral/fileexchange/9594

Once it finds the offending m-file, I would then see where and
how it is called by your scripts.

HTH,
John

Subject: Phantom code appears in diary!

From: Walter Roberson

Date: 6 Sep, 2010 20:12:52

Message: 5 of 7

On 06/09/10 10:27 AM, dan berkowitz wrote:

> I am running a series of m-files and loggin thier execution in a log
> file using teh diary commend.
>
> Surprisingly, when I open the log file, I keep seeing this code which
> doesn't appear in any of my m-files!!!
>
> % Modify expression to add input arguments.
> % Example:
> % a = [1 2 3; 4 5 6]; % foo(a);

Possibly it is in the startup.m file? Which might perhaps be in your
preferences directory.

cd prefdir

Subject: Phantom code appears in diary!

From: Kevin

Date: 6 Sep, 2011 06:24:10

Message: 6 of 7

"dan berkowitz" wrote in message <i6318a$22k$1@fred.mathworks.com>...
> Hi,
> I am running a series of m-files and loggin thier execution in a log file using teh diary commend.
>
> Surprisingly, when I open the log file, I keep seeing this code which doesn't appear in any of my m-files!!!
>
> % Modify expression to add input arguments.
> % Example:
> % a = [1 2 3; 4 5 6];
> % foo(a);
>
> can someone please help me get rid of this 'phantom' code!!!
>
> Thank you!
>
> db


Hi Dan,
I just came across your same problem. I'm sure it has already been addressed at this point, but I encountered that code in my diary files when I was pressing the play button to run my programs. The code stopped appearing as soon as I used the syntax run('your m file name') to open my programs instead.

Subject: Phantom code appears in diary!

From: Steven_Lord

Date: 6 Sep, 2011 13:41:07

Message: 7 of 7



"Kevin " <kspellma@utk.edu> wrote in message
news:j44eaa$8sj$1@newscl01ah.mathworks.com...
> "dan berkowitz" wrote in message <i6318a$22k$1@fred.mathworks.com>...
>> Hi,
>> I am running a series of m-files and loggin thier execution in a log
>> file using teh diary commend.
>>
>> Surprisingly, when I open the log file, I keep seeing this code which
>> doesn't appear in any of my m-files!!!
>>
>> % Modify expression to add input arguments.
>> % Example:
>> % a = [1 2 3; 4 5 6]; % foo(a);
>>
>> can someone please help me get rid of this 'phantom' code!!!
>>
>> Thank you!
>>
>> db
>
>
> Hi Dan,
> I just came across your same problem. I'm sure it has already been
> addressed at this point, but I encountered that code in my diary files
> when I was pressing the play button to run my programs. The code stopped
> appearing as soon as I used the syntax run('your m file name') to open my
> programs instead.

That looks like a run configuration:

http://www.mathworks.com/help/techdoc/matlab_env/brqxeeu-131.html

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

Tags for 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