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 mode execution

Subject: cell mode execution

From: Alan B

Date: 3 Apr, 2009 16:08:01

Message: 1 of 15

Is there any way to see where an error is, when ctrl-enter execution in cell mode fails? I like cell mode but I can't use it because it makes debugging impossible, when I just get a popup box saying "the cell cannot be evaluated". How can I get a more informative message? Is this just fixed in a later version? I have 2006b.

Subject: cell mode execution

From: Matthew Simoneau

Date: 3 Apr, 2009 16:24:00

Message: 2 of 15

Yes, this message isn't very helpful. I think you see it when there is an invalid syntax, i.e. a parse error. If you hit "F5" to run the whole file, does a better error message print to the command window?

Subject: cell mode execution

From: Alan B

Date: 3 Apr, 2009 23:01:02

Message: 3 of 15

"Matthew Simoneau" <matthew@mathworks.com> wrote in message <gr5d70$5fc$1@fred.mathworks.com>...
> Yes, this message isn't very helpful. I think you see it when there is an invalid syntax, i.e. a parse error. If you hit "F5" to run the whole file, does a better error message print to the command window?

Yes I see a helpful message when I use F5. I usually just end up converting the script to a function, which also allows me to see helpful messages. Sometimes I want the added functionality of cell mode though - is there no way to combine cell mode with meaningful error messages?

Thanks

Subject: cell mode execution

From: Matthew Simoneau

Date: 3 Apr, 2009 23:38:02

Message: 4 of 15

You'd think so! This limitation actually goes deep into the dark corners of MATLAB and reflects architectural decisions that were made a long time ago. It is on our radar, but will take some time to work this out.

Subject: cell mode execution

From: Matt Raum

Date: 22 Mar, 2013 20:50:18

Message: 5 of 15

The poor error reporting in cell mode execution is still a major drawback to developing this way. I'm running MATLAB Version 7.13.0.564 (R2011b). Is there still nothing that can be done to get more informative error messages??

For instance, I might execute a 200 line cell and get the following message at the command line:

Index exceeds matrix dimensions.

Then I have to figure out which of the 200 lines caused this error -- exhausting.....it would be really great if a machine could do that for me.

Subject: cell mode execution

From: anyone

Date: 23 Mar, 2013 19:04:48

Message: 6 of 15

On Fri, 22 Mar 2013 20:50:18 +0000, Matt Raum wrote:

> The poor error reporting in cell mode execution is still a major
> drawback to developing this way.

so... you'd prefer it was silent, or were hoping Matlab would simply re-code itself in some way?

> I'm running MATLAB Version 7.13.0.564
> (R2011b). Is there still nothing that can be done to get more
> informative error messages??

See: Help -> breakpoint

> For instance, I might execute a 200 line cell and get the following
> message at the command line:
>
> Index exceeds matrix dimensions.
>
> Then I have to figure out which of the 200 lines caused this error --
> exhausting.....it would be really great if a machine could do that for
> me.

damned computers, eh? ...always trying to do what you say, not what you mean.

Subject: cell mode execution

From: Alan B

Date: 1 Apr, 2013 20:05:12

Message: 7 of 15

anyone <jaup@h/WSWLG{nR1³qHe> wrote in message <514dfcd0$0$13514$c3e8da3$dd9697d2@news.astraweb.com>...
> On Fri, 22 Mar 2013 20:50:18 +0000, Matt Raum wrote:
>
> > The poor error reporting in cell mode execution is still a major
> > drawback to developing this way.
>
> so... you'd prefer it was silent, or were hoping Matlab would simply re-code itself in some way?
>
> > I'm running MATLAB Version 7.13.0.564
> > (R2011b). Is there still nothing that can be done to get more
> > informative error messages??
>
> See: Help -> breakpoint
>
> > For instance, I might execute a 200 line cell and get the following
> > message at the command line:
> >
> > Index exceeds matrix dimensions.
> >
> > Then I have to figure out which of the 200 lines caused this error --
> > exhausting.....it would be really great if a machine could do that for
> > me.
>
> damned computers, eh? ...always trying to do what you say, not what you mean.
>

It seems a reasonable request, considering that A) the machine CAN do it for us, in the context of a function, and B) it was "on the radar" as of four years ago.

Subject: cell mode execution

From: anyone

Date: 1 Apr, 2013 20:15:38

Message: 8 of 15

On Mon, 01 Apr 2013 20:05:12 +0000, Alan B wrote:

> anyone <jaup@h/WSWLG{nR1³qHe> wrote in message
> <514dfcd0$0$13514$c3e8da3$dd9697d2@news.astraweb.com>...
>> On Fri, 22 Mar 2013 20:50:18 +0000, Matt Raum wrote:
>>
>> > The poor error reporting in cell mode execution is still a major
>> > drawback to developing this way.
>>
>> so... you'd prefer it was silent, or were hoping Matlab would simply
>> re-code itself in some way?
>>
>> > I'm running MATLAB Version 7.13.0.564 (R2011b). Is there still
>> > nothing that can be done to get more informative error messages??
>>
>> See: Help -> breakpoint
>>
>> > For instance, I might execute a 200 line cell and get the following
>> > message at the command line:
>> >
>> > Index exceeds matrix dimensions.
>> >
>> > Then I have to figure out which of the 200 lines caused this error --
>> > exhausting.....it would be really great if a machine could do that
>> > for me.
>>
>> damned computers, eh? ...always trying to do what you say, not what you
>> mean.
>>
> It seems a reasonable request, considering that A) the machine CAN do it
> for us, in the context of a function, and B) it was "on the radar" as of
> four years ago.

It would be nice if my keyboard could learn how to spell.

Subject: cell mode execution

From: Alan B

Date: 2 Apr, 2013 02:33:08

Message: 9 of 15

anyone <jaup@h/WSWLG{nR1³qHe> wrote in message <5159eaea$0$33856$c3e8da3$a9097924@news.astraweb.com>...
> On Mon, 01 Apr 2013 20:05:12 +0000, Alan B wrote:
>
> > anyone <jaup@h/WSWLG{nR1³qHe> wrote in message
> > <514dfcd0$0$13514$c3e8da3$dd9697d2@news.astraweb.com>...
> >> On Fri, 22 Mar 2013 20:50:18 +0000, Matt Raum wrote:
> >>
> >> > The poor error reporting in cell mode execution is still a major
> >> > drawback to developing this way.
> >>
> >> so... you'd prefer it was silent, or were hoping Matlab would simply
> >> re-code itself in some way?
> >>
> >> > I'm running MATLAB Version 7.13.0.564 (R2011b). Is there still
> >> > nothing that can be done to get more informative error messages??
> >>
> >> See: Help -> breakpoint
> >>
> >> > For instance, I might execute a 200 line cell and get the following
> >> > message at the command line:
> >> >
> >> > Index exceeds matrix dimensions.
> >> >
> >> > Then I have to figure out which of the 200 lines caused this error --
> >> > exhausting.....it would be really great if a machine could do that
> >> > for me.
> >>
> >> damned computers, eh? ...always trying to do what you say, not what you
> >> mean.
> >>
> > It seems a reasonable request, considering that A) the machine CAN do it
> > for us, in the context of a function, and B) it was "on the radar" as of
> > four years ago.
>
> It would be nice if my keyboard could learn how to spell.

You're in luck, that problem was solved long ago! See: http://www.logitech.com/en-us/support/180 .

Would you mind explaining why you believe this request to be unreasonable and/or naive? That might be more helpful to future readers.

Subject: cell mode execution

From: anyone

Date: 2 Apr, 2013 04:33:54

Message: 10 of 15

On Tue, 02 Apr 2013 02:33:08 +0000, Alan B wrote:

> anyone <jaup@h/WSWLG{nR1³qHe> wrote in message
> <5159eaea$0$33856$c3e8da3$a9097924@news.astraweb.com>...
>> On Mon, 01 Apr 2013 20:05:12 +0000, Alan B wrote:
>>
>> > anyone <jaup@h/WSWLG{nR1³qHe> wrote in message
>> > <514dfcd0$0$13514$c3e8da3$dd9697d2@news.astraweb.com>...
>> >> On Fri, 22 Mar 2013 20:50:18 +0000, Matt Raum wrote:
>> >>
>> >> > The poor error reporting in cell mode execution is still a major
>> >> > drawback to developing this way.
>> >>
>> >> so... you'd prefer it was silent, or were hoping Matlab would simply
>> >> re-code itself in some way?
>> >>
>> >> > I'm running MATLAB Version 7.13.0.564 (R2011b). Is there still
>> >> > nothing that can be done to get more informative error messages??
>> >>
>> >> See: Help -> breakpoint
>> >>
>> >> > For instance, I might execute a 200 line cell and get the
>> >> > following message at the command line:
>> >> >
>> >> > Index exceeds matrix dimensions.
>> >> >
>> >> > Then I have to figure out which of the 200 lines caused this error
>> >> > --
>> >> > exhausting.....it would be really great if a machine could do that
>> >> > for me.
>> >>
>> >> damned computers, eh? ...always trying to do what you say, not what
>> >> you mean.
>> >>
>> > It seems a reasonable request, considering that A) the machine CAN do
>> > it for us, in the context of a function, and B) it was "on the radar"
>> > as of four years ago.
>>
>> It would be nice if my keyboard could learn how to spell.
>
> You're in luck, that problem was solved long ago! See:
> http://www.logitech.com/en-us/support/180 .
>
> Would you mind explaining why you believe this request to be
> unreasonable and/or naive? That might be more helpful to future readers.

Yes, I would.

Subject: cell mode execution

From: Alan B

Date: 2 Apr, 2013 11:36:06

Message: 11 of 15

anyone <jaup@h/WSWLG{nR1³qHe> wrote in message <515a5fb2$0$52138$c3e8da3$5d8fb80f@news.astraweb.com>...
> On Tue, 02 Apr 2013 02:33:08 +0000, Alan B wrote:
>
> > anyone <jaup@h/WSWLG{nR1³qHe> wrote in message
> > <5159eaea$0$33856$c3e8da3$a9097924@news.astraweb.com>...
> >> On Mon, 01 Apr 2013 20:05:12 +0000, Alan B wrote:
> >>
> >> > anyone <jaup@h/WSWLG{nR1³qHe> wrote in message
> >> > <514dfcd0$0$13514$c3e8da3$dd9697d2@news.astraweb.com>...
> >> >> On Fri, 22 Mar 2013 20:50:18 +0000, Matt Raum wrote:
> >> >>
> >> >> > The poor error reporting in cell mode execution is still a major
> >> >> > drawback to developing this way.
> >> >>
> >> >> so... you'd prefer it was silent, or were hoping Matlab would simply
> >> >> re-code itself in some way?
> >> >>
> >> >> > I'm running MATLAB Version 7.13.0.564 (R2011b). Is there still
> >> >> > nothing that can be done to get more informative error messages??
> >> >>
> >> >> See: Help -> breakpoint
> >> >>
> >> >> > For instance, I might execute a 200 line cell and get the
> >> >> > following message at the command line:
> >> >> >
> >> >> > Index exceeds matrix dimensions.
> >> >> >
> >> >> > Then I have to figure out which of the 200 lines caused this error
> >> >> > --
> >> >> > exhausting.....it would be really great if a machine could do that
> >> >> > for me.
> >> >>
> >> >> damned computers, eh? ...always trying to do what you say, not what
> >> >> you mean.
> >> >>
> >> > It seems a reasonable request, considering that A) the machine CAN do
> >> > it for us, in the context of a function, and B) it was "on the radar"
> >> > as of four years ago.
> >>
> >> It would be nice if my keyboard could learn how to spell.
> >
> > You're in luck, that problem was solved long ago! See:
> > http://www.logitech.com/en-us/support/180 .
> >
> > Would you mind explaining why you believe this request to be
> > unreasonable and/or naive? That might be more helpful to future readers.
>
> Yes, I would.

Another suggestion then: stop making content-free posts,

Subject: cell mode execution

From: Steven_Lord

Date: 2 Apr, 2013 15:07:33

Message: 12 of 15



"Alan B" <monguin61REM@OVETHIS.yahoo.com> wrote in message
news:kjcp9o$pal$1@newscl01ah.mathworks.com...
> anyone <jaup@h/WSWLG{nR1qHe> wrote in message
> <514dfcd0$0$13514$c3e8da3$dd9697d2@news.astraweb.com>...
>> On Fri, 22 Mar 2013 20:50:18 +0000, Matt Raum wrote:
>>
>> > The poor error reporting in cell mode execution is still a major
>> > drawback to developing this way.
>>
>> so... you'd prefer it was silent, or were hoping Matlab would simply
>> re-code itself in some way?
>>
>> > I'm running MATLAB Version 7.13.0.564
>> > (R2011b). Is there still nothing that can be done to get more
>> > informative error messages??

The way MATLAB executes code when you evaluate on a cell-by-cell basis is
slightly different from the regular way MATLAB functions or scripts run and
that difference makes doing what you request a little trickier than you
might expect.

>> See: Help -> breakpoint

Good suggestion anyone, but it won't work in this particular case. Running
individual code sections ignores breakpoints.

http://www.mathworks.com/help/matlab/matlab_prog/run-sections-of-programs.html

>> > For instance, I might execute a 200 line cell and get the following
>> > message at the command line:
>> >
>> > Index exceeds matrix dimensions.
>> >
>> > Then I have to figure out which of the 200 lines caused this error --
>> > exhausting.....it would be really great if a machine could do that for
>> > me.

It would be great. But the cell execution mechanism is currently not able to
do so.

Some workarounds you can use right now:

1) Select the first half of the code in the cell and right-click. Evaluate
that selection. If the error occurs, the problem is in the first half of
your cell's code; if not, it's in the second half. Repeat this binary search
until you've located the error.
2) Break your 200 line cell into smaller cells. The less code you have to
look through to isolate the issue, the easier it will be to locate.
3) Run your code normally (not cell-by-cell) with breakpoints as anyone
suggested, locate the issue, fix it, then return to your workflow of
executing cell-by-cell.

>> damned computers, eh? ...always trying to do what you say, not what you
>> mean.
>>
>
> It seems a reasonable request, considering that A) the machine CAN do it
> for us, in the context of a function, and B) it was "on the radar" as of
> four years ago.

It is still on the radar. It has not come in for a landing yet as of the
current release R2013a.

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

Subject: cell mode execution

From: Alan B

Date: 2 Apr, 2013 16:00:13

Message: 13 of 15

"Steven_Lord" <slord@mathworks.com> wrote in message <kjes7l$6eu$1@newscl01ah.mathworks.com>...
>
>
> "Alan B" <monguin61REM@OVETHIS.yahoo.com> wrote in message
> news:kjcp9o$pal$1@newscl01ah.mathworks.com...
> > anyone <jaup@h/WSWLG{nR1qHe> wrote in message
> > <514dfcd0$0$13514$c3e8da3$dd9697d2@news.astraweb.com>...
> >> On Fri, 22 Mar 2013 20:50:18 +0000, Matt Raum wrote:
> >>
> >> > The poor error reporting in cell mode execution is still a major
> >> > drawback to developing this way.
> >>
> >> so... you'd prefer it was silent, or were hoping Matlab would simply
> >> re-code itself in some way?
> >>
> >> > I'm running MATLAB Version 7.13.0.564
> >> > (R2011b). Is there still nothing that can be done to get more
> >> > informative error messages??
>
> The way MATLAB executes code when you evaluate on a cell-by-cell basis is
> slightly different from the regular way MATLAB functions or scripts run and
> that difference makes doing what you request a little trickier than you
> might expect.
>
> >> See: Help -> breakpoint
>
> Good suggestion anyone, but it won't work in this particular case. Running
> individual code sections ignores breakpoints.
>
> http://www.mathworks.com/help/matlab/matlab_prog/run-sections-of-programs.html
>
> >> > For instance, I might execute a 200 line cell and get the following
> >> > message at the command line:
> >> >
> >> > Index exceeds matrix dimensions.
> >> >
> >> > Then I have to figure out which of the 200 lines caused this error --
> >> > exhausting.....it would be really great if a machine could do that for
> >> > me.
>
> It would be great. But the cell execution mechanism is currently not able to
> do so.
>
> Some workarounds you can use right now:
>
> 1) Select the first half of the code in the cell and right-click. Evaluate
> that selection. If the error occurs, the problem is in the first half of
> your cell's code; if not, it's in the second half. Repeat this binary search
> until you've located the error.
> 2) Break your 200 line cell into smaller cells. The less code you have to
> look through to isolate the issue, the easier it will be to locate.
> 3) Run your code normally (not cell-by-cell) with breakpoints as anyone
> suggested, locate the issue, fix it, then return to your workflow of
> executing cell-by-cell.
>
> >> damned computers, eh? ...always trying to do what you say, not what you
> >> mean.
> >>
> >
> > It seems a reasonable request, considering that A) the machine CAN do it
> > for us, in the context of a function, and B) it was "on the radar" as of
> > four years ago.
>
> It is still on the radar. It has not come in for a landing yet as of the
> current release R2013a.
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

Thank you, Steve. I appreciate the explanation, and I understand that implementing it is not trivial. I do not appreciate being treated like an ignorant child by 'anyone', for making a reasonable feature request for software that I pay for.

Subject: cell mode execution

From: anyone

Date: 2 Apr, 2013 23:26:30

Message: 14 of 15

On Tue, 02 Apr 2013 11:07:33 -0400, Steven_Lord wrote:

> "Alan B" <monguin61REM@OVETHIS.yahoo.com> wrote in message
> news:kjcp9o$pal$1@newscl01ah.mathworks.com...
>> anyone <jaup@h/WSWLG{nR1³qHe> wrote in message
>> <514dfcd0$0$13514$c3e8da3$dd9697d2@news.astraweb.com>...
>>> On Fri, 22 Mar 2013 20:50:18 +0000, Matt Raum wrote:
>>>
>>> > The poor error reporting in cell mode execution is still a major
>>> > drawback to developing this way.
>>>
>>> so... you'd prefer it was silent, or were hoping Matlab would simply
>>> re-code itself in some way?
>>>
>>> > I'm running MATLAB Version 7.13.0.564 (R2011b). Is there still
>>> > nothing that can be done to get more informative error messages??
>
> The way MATLAB executes code when you evaluate on a cell-by-cell basis
> is slightly different from the regular way MATLAB functions or scripts
> run and that difference makes doing what you request a little trickier
> than you might expect.
>
>>> See: Help -> breakpoint
>
> Good suggestion anyone, but it won't work in this particular case.
> Running individual code sections ignores breakpoints.
>
> http://www.mathworks.com/help/matlab/matlab_prog/run-sections-of-programs.html
>
[...]
aside: I may have read-through it a bit quickly, but had presumed the OP would attempt an ordinary de-bug -- no cell-
by-cell execution.

Subject: cell mode execution

From: anyone

Date: 2 Apr, 2013 23:29:48

Message: 15 of 15

On Tue, 02 Apr 2013 11:36:06 +0000, Alan B wrote:

> anyone <jaup@h/WSWLG{nR1³qHe> wrote in message
> <515a5fb2$0$52138$c3e8da3$5d8fb80f@news.astraweb.com>...
>> On Tue, 02 Apr 2013 02:33:08 +0000, Alan B wrote:
>>
>> > anyone <jaup@h/WSWLG{nR1³qHe> wrote in message
>> > <5159eaea$0$33856$c3e8da3$a9097924@news.astraweb.com>...
>> >> On Mon, 01 Apr 2013 20:05:12 +0000, Alan B wrote:
>> >>
>> >> > anyone <jaup@h/WSWLG{nR1³qHe> wrote in message
>> >> > <514dfcd0$0$13514$c3e8da3$dd9697d2@news.astraweb.com>...
>> >> >> On Fri, 22 Mar 2013 20:50:18 +0000, Matt Raum wrote:
>> >> >>
>> >> >> > The poor error reporting in cell mode execution is still a
>> >> >> > major drawback to developing this way.
>> >> >>
>> >> >> so... you'd prefer it was silent, or were hoping Matlab would
>> >> >> simply re-code itself in some way?
>> >> >>
>> >> >> > I'm running MATLAB Version 7.13.0.564 (R2011b). Is there still
>> >> >> > nothing that can be done to get more informative error
>> >> >> > messages??
>> >> >>
>> >> >> See: Help -> breakpoint
>> >> >>
>> >> >> > For instance, I might execute a 200 line cell and get the
>> >> >> > following message at the command line:
>> >> >> >
>> >> >> > Index exceeds matrix dimensions.
>> >> >> >
>> >> >> > Then I have to figure out which of the 200 lines caused this
>> >> >> > error --
>> >> >> > exhausting.....it would be really great if a machine could do
>> >> >> > that for me.
>> >> >>
>> >> >> damned computers, eh? ...always trying to do what you say, not
>> >> >> what you mean.
>> >> >>
>> >> > It seems a reasonable request, considering that A) the machine CAN
>> >> > do it for us, in the context of a function, and B) it was "on the
>> >> > radar"
>> >> > as of four years ago.
>> >>
>> >> It would be nice if my keyboard could learn how to spell.
>> >
>> > You're in luck, that problem was solved long ago! See:
>> > http://www.logitech.com/en-us/support/180 .
>> >
>> > Would you mind explaining why you believe this request to be
>> > unreasonable and/or naive? That might be more helpful to future
>> > readers.
>>
>> Yes, I would.
>
> Another suggestion then: stop making content-free posts,

Request denied.

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