I'm trying to simulate a bipolar NRZ of [1 1 0 0 1 0 0 0 1 1] on SCILAB. But I keep getting error of "invalid index". Need help...
This is the error that I get on SCILAB.
This is my source code. source code
I'm trying to simulate a bipolar NRZ of [1 1 0 0 1 0 0 0 1 1] on SCILAB. But I keep getting error of "invalid index". Need help...
This is the error that I get on SCILAB.
This is my source code. source code
Copyright © 2021 Jogjafile Inc.
It looks like a simple indexing error.
Remember that, in
Scilab, arrays are indexed starting from1(not0likePythonor other languages)In your code, you are checking a
elseifcondition involvingx(i - 1)and yourforloop loops through1:L, so, at the first comparison iteration,x(0)will be tested, which is undefined/invalid.