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

New to MATLAB?

Thread Subject:
what does double % mean?

Subject: what does double % mean?

From: Yi

Date: 11 Sep, 2010 22:06:04

Message: 1 of 2

Hi guys:

I have a simple question. I understand one % means comment, but today by mistake I typed %% and it seems it is not comment any more.

Is there any special meaning of %%?



Subject: what does double % mean?

From: ImageAnalyst

Date: 11 Sep, 2010 22:17:41

Message: 2 of 2

If it's like a comment, then it means that is the start of a "cell"
which is a block of statements that gets executed as a whole. For
example, it will execute 10 statements instead of one when you do a
"step" - it goes until the next %%.

And if it's inside a quoted string, it means to print out or display a
percent symbol. Otherwise (a single one) it's part of the format
descriptor (like %d, %.3f, %s, etc) so how would you ever be able to
get a single %?

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