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:
Problem with "Subscript indices"

Subject: Problem with "Subscript indices"

From: Ag

Date: 20 Feb, 2009 09:43:02

Message: 1 of 3

Hi all,

I have a problem when running my code and I want to create a matrix like

b=zeros(size(a));

The following error appears:

"??? Subscript indices must either be real positive integers or logicals."

Why is this happening?? and what can I do to avoid this ANNOYING problem??

Thanks!!


A desperated modeller

Subject: Problem with "Subscript indices"

From: nor ki

Date: 20 Feb, 2009 09:57:01

Message: 2 of 3

"Ag" <ag@gmail.com> wrote in message <gnltv5$eo3$1@fred.mathworks.com>...
> Hi all,
>
> I have a problem when running my code and I want to create a matrix like
>
> b=zeros(size(a));
>
> The following error appears:
>
> "??? Subscript indices must either be real positive integers or logicals."
>
> Why is this happening?? and what can I do to avoid this ANNOYING problem??
>
> Thanks!!
>
>
> A desperated modeller

Hi desperated modeller

have you checkeck size(a) ?

hth kinor

Subject: Problem with "Subscript indices"

From: Ag

Date: 20 Feb, 2009 10:10:20

Message: 3 of 3

Yes hth kinor

Indeed, the guy that wrote the code before me did not realize that size is a function so he defined size as a variable.

Thanks

A.


"nor ki" <kinor.removeme@gmx.de> wrote in message <gnlupd$g9o$1@fred.mathworks.com>...
> "Ag" <ag@gmail.com> wrote in message <gnltv5$eo3$1@fred.mathworks.com>...
> > Hi all,
> >
> > I have a problem when running my code and I want to create a matrix like
> >
> > b=zeros(size(a));
> >
> > The following error appears:
> >
> > "??? Subscript indices must either be real positive integers or logicals."
> >
> > Why is this happening?? and what can I do to avoid this ANNOYING problem??
> >
> > Thanks!!
> >
> >
> > A desperated modeller
>
> Hi desperated modeller
>
> have you checkeck size(a) ?
>
> hth kinor

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