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:
Cell identifier...

Subject: Cell identifier...

From: Oleg

Date: 15 May, 2009 01:46:02

Message: 1 of 4

Hi All,

I'm learning Matlab, and have few questions:

1. Why cell identifier '%%' doesn't work in all my m-files? If I start new file and put %% - it works. But in my old files when I'm trying to separate code with cells - it doesn't work. I have cells mode ON, and checked all the preferences - it should work. And even if I copy my old codes to new file - cells doesn't work again. I'm depressed.

2. Will %% work in txt files created outside Matlab and saved as .m files?

Thanks,
Oleg

Subject: Cell identifier...

From: Matthew Simoneau

Date: 15 May, 2009 20:38:01

Message: 2 of 4

"%%" is simply text. It should work in the Editor with all files that end with a ".m" extension, regardless of how old they are or what application created them. If you're creating them in another application, just be sure the extension is correct.

Subject: Cell identifier...

From: Jiro Doke

Date: 16 May, 2009 02:23:02

Message: 3 of 4

"Oleg " <olugovoy@hotmail.com> wrote in message <guihgp$q6h$1@fred.mathworks.com>...
> Hi All,
>
> I'm learning Matlab, and have few questions:
>
> 1. Why cell identifier '%%' doesn't work in all my m-files? If I start new file and put %% - it works. But in my old files when I'm trying to separate code with cells - it doesn't work. I have cells mode ON, and checked all the preferences - it should work. And even if I copy my old codes to new file - cells doesn't work again. I'm depressed.
>
> 2. Will %% work in txt files created outside Matlab and saved as .m files?
>
> Thanks,
> Oleg

Make sure that your m-file doesn't have any syntax errors. Run m-lint on the file:

>> help mlint

Or if you have m-lint turned on the editor, check to see if the color of it (on the right edge of the editor window) is red. If it is, then there's a syntax error. In the newer releases of MATLAB, if you have a syntax error in your m-file, you won't be able to create new cells.

http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/brqxeeu-259.html#brqxeeu-282

Subject: Cell identifier...

From: Morten

Date: 24 May, 2010 14:35:23

Message: 4 of 4

Hi Oleg

I have the same problem, the cell identifier '%%' doesn't work in all my m-files even though cell mode is active and there is no syntax errors. The problem can be solved by simply creating a new m-file and copy/pasting the content of the 'old' file into the new. This workaround works but it is quite annoying having to do this...

Morten

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