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:
Line of code too long

Subject: Line of code too long

From: Philosophaie

Date: 24 Feb, 2009 07:57:01

Message: 1 of 5

If the line you are entering becomes too long and part of it turns "Tan". What symbol or symbols do you use to split the line of code and put part of it on the next line so the line of code remains as if one?

Subject: Line of code too long

From: Philosophaie

Date: 24 Feb, 2009 08:13:02

Message: 2 of 5

Also could someone please tell me what line of code to close the GUI if you put it in a callback.

Subject: Line of code too long

From: Eric

Date: 24 Feb, 2009 09:22:01

Message: 3 of 5

"Philosophaie" <ertlejack@sbcglobal.net> wrote in message <go098d$b3i$1@fred.mathworks.com>...
> If the line you are entering becomes too long and part of it turns "Tan". What symbol or symbols do you use to split the line of code and put part of it on the next line so the line of code remains as if one?

Three points "..." are used to split lines of code.
a = 1 + ... all behind the points is regarded as comment
            2;

Subject: Line of code too long

From: Philosophaie

Date: 24 Feb, 2009 09:30:04

Message: 4 of 5

"Philosophaie" <ertlejack@sbcglobal.net> wrote in message <go098d$b3i$1@fred.mathworks.com>...
> If the line you are entering becomes too long and part of it turns "Tan". What symbol or symbols do you use to split the line of code and put part of it on the next line so the line of code remains as if one?

The Tan color that occured was because there was a "!" in my folder name.

Subject: Line of code too long

From: Steven Lord

Date: 24 Feb, 2009 15:00:14

Message: 5 of 5


"Philosophaie" <ertlejack@sbcglobal.net> wrote in message
news:go0ems$nlv$1@fred.mathworks.com...
> "Philosophaie" <ertlejack@sbcglobal.net> wrote in message
> <go098d$b3i$1@fred.mathworks.com>...
>> If the line you are entering becomes too long and part of it turns "Tan".
>> What symbol or symbols do you use to split the line of code and put part
>> of it on the next line so the line of code remains as if one?
>
> The Tan color that occured was because there was a "!" in my folder name.

Anything after ! on a line of code is treated as part of a command to be
passed to the OS.

Let me guess, you're trying to access a file (using LOAD, SAVE, FOPEN, etc.)
and you're using the command form on a file name that contains both a space
and an exclamation point (sometimes called bang)

load c:\Program Files\MATLAB\SaveHere!\mymatfile.mat

You'll probably get an error when MATLAB tries to parse this, as there's no
space between the end of what it thinks is the previous command:

load c:\Program Files\MATLAB\SaveHere
% which is the same as:
load('c:\Program', 'Files\MATLAB\SaveHere')

and the attempt to bang out and execute:

\mymatfile.mat

at the system prompt.

If you wrap the file name in single quotes, it will be treated as a string
and the problem should go away.

% Specifying an output argument for workspace cleanliness
S = load('c:\Program Files\MATLAB\SaveHere!\mymatfile.mat')

--
Steve Lord
slord@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