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:
solving matlab syntax error

Subject: solving matlab syntax error

From: MICHAEL

Date: 8 Feb, 2008 19:17:03

Message: 1 of 2

hello

i have a problem with the following line:
faddedSignal=[signal(1:3*upSample).',(signal(3*upSample+1:end-3*upSample).*fadding).',signal(end-3*upSample+1:end).'];

i get from the matlab:
"END or Colon is apparently used to index a non-array"

when this line wasn't in function, there weren't any problem
with this line. after the change of the line into function,
i got this error.

how should i solve it?

Subject: solving matlab syntax error

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 8 Feb, 2008 19:55:04

Message: 2 of 2

In article <foi9rf$t79$1@fred.mathworks.com>,
michael <bezenchu@gmail.com> wrote:

>i have a problem with the following line:
>faddedSignal=[signal(1:3*upSample).',(signal(3*upSample+1:end-3*upSample).*fadding).',signal(end-3*upSample+1:end).'];

>i get from the matlab:
>"END or Colon is apparently used to index a non-array"

>when this line wasn't in function, there weren't any problem
>with this line. after the change of the line into function,
>i got this error.

>how should i solve it?

Matlab believes that signal() may be a function at that point.
Double check that you do not have a signal() function on your path.

When Matlab guesses wrong about whether a given identifier is
an array or function, you can often force Matlab to think of it
as an array by having a prominent assignment in view, even if it is
of the form signal(1) = signal(1)

--
  "There are some ideas so wrong that only a very intelligent person
  could believe in them." -- George Orwell

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