"Mike Lim" <yoong.lim.nospam@eng.monash.edu.au> wrote in
message <fmcf4r$re6$1@fred.mathworks.com>...
> Hi Folks,
>
> I am struck with an error message with Matlab for
> sometime.
>
> >> whos data_daq2
> Name Size Bytes Class
>
> data_daq2 500x2 8000 double
> array
>
> Grand total is 1000 elements using 8000 bytes
>
> >> data_daq2
>
> data_daq2 =
>
> -0.3683 -0.3171
> -1.1497 -1.0985
> 0.4131 0.4644
> -0.3683 1.2458
> -0.3683 -1.0985
> 0.4131 1.2458
> 0.4131 0.4644
> 1.1946 -0.3171
>
> .... blaq blaq ..... alot more data, I truncated the rest.
>
> The problem is I cannot do a diff (I am trying to do a
> numerical approximate differentiation.
>
>
> >> diff(data_daq2(:,1))
> ??? Subscript indices must either be real positive integers
> or logicals.
>
> The weird thing is I have managed to do the same
> diff(data_daq2(:,1)) in a earlier version of code.
>
> I am pretty sure and I know that initial vector position is
> 1. So this is not the syntax error I am running into.
>
> Please advise.
>
> Thank you.
>
>
It maybe that you have a variable named 'diff' or your own
file use the same name as the built-in function diff.m.
"Anh Huy Phan" <phananhhuy@mathworks.com> wrote in message
<fmcgnm$8ml$1@fred.mathworks.com>...
> "Mike Lim" <yoong.lim.nospam@eng.monash.edu.au> wrote in
> message <fmcf4r$re6$1@fred.mathworks.com>...
> > Hi Folks,
> >
> > I am struck with an error message with Matlab for
> > sometime.
> >
> > >> whos data_daq2
> > Name Size Bytes Class
> >
> > data_daq2 500x2 8000 double
> > array
> >
> > Grand total is 1000 elements using 8000 bytes
> >
> > >> data_daq2
> >
> > data_daq2 =
> >
> > -0.3683 -0.3171
> > -1.1497 -1.0985
> > 0.4131 0.4644
> > -0.3683 1.2458
> > -0.3683 -1.0985
> > 0.4131 1.2458
> > 0.4131 0.4644
> > 1.1946 -0.3171
> >
> > .... blaq blaq ..... alot more data, I truncated the
rest.
> >
> > The problem is I cannot do a diff (I am trying to do a
> > numerical approximate differentiation.
> >
> >
> > >> diff(data_daq2(:,1))
> > ??? Subscript indices must either be real positive
integers
> > or logicals.
> >
> > The weird thing is I have managed to do the same
> > diff(data_daq2(:,1)) in a earlier version of code.
> >
> > I am pretty sure and I know that initial vector
position is
> > 1. So this is not the syntax error I am running into.
> >
> > Please advise.
> >
> > Thank you.
> >
> >
>
>
> It maybe that you have a variable named 'diff' or your
own
> file use the same name as the built-in function diff.m.
>
> For checking, type in the command line
> open diff
>
> or
> whos diff
>
> Anh Huy Phan
> RIKEN - BSI
Is there any way for me to prevent such things from
happening?
As in, I will have a warning message from Matlab if I redo
something silly in the future?
Any command / options?
Thank you.
"Anh Huy Phan" <phananhhuy@mathworks.com> wrote in message
<fmcgnm$8ml$1@fred.mathworks.com>...
> "Mike Lim" <yoong.lim.nospam@eng.monash.edu.au> wrote in
> message <fmcf4r$re6$1@fred.mathworks.com>...
> > Hi Folks,
> >
> > I am struck with an error message with Matlab for
> > sometime.
> >
> > >> whos data_daq2
> > Name Size Bytes Class
> >
> > data_daq2 500x2 8000 double
> > array
> >
> > Grand total is 1000 elements using 8000 bytes
> >
> > >> data_daq2
> >
> > data_daq2 =
> >
> > -0.3683 -0.3171
> > -1.1497 -1.0985
> > 0.4131 0.4644
> > -0.3683 1.2458
> > -0.3683 -1.0985
> > 0.4131 1.2458
> > 0.4131 0.4644
> > 1.1946 -0.3171
> >
> > .... blaq blaq ..... alot more data, I truncated the
rest.
> >
> > The problem is I cannot do a diff (I am trying to do a
> > numerical approximate differentiation.
> >
> >
> > >> diff(data_daq2(:,1))
> > ??? Subscript indices must either be real positive
integers
> > or logicals.
> >
> > The weird thing is I have managed to do the same
> > diff(data_daq2(:,1)) in a earlier version of code.
> >
> > I am pretty sure and I know that initial vector
position is
> > 1. So this is not the syntax error I am running into.
> >
> > Please advise.
> >
> > Thank you.
> >
> >
>
>
> It maybe that you have a variable named 'diff' or your
own
> file use the same name as the built-in function diff.m.
>
> For checking, type in the command line
> open diff
>
> or
> whos diff
>
> Anh Huy Phan
> RIKEN - BSI
Tags for this Thread
Add a New Tag:
Separated by commas
Ex.: root locus, bode
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.
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Disclaimer prior to use.