cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

This array index is invalid. The index must be an integer, not less than ORIGIN

Yunus_Demirol
8-Gravel

This array index is invalid. The index must be an integer, not less than ORIGIN

Hello everyone 🙂

 

I want to do exponential regression, I saw a YouTube source about it. Link https://www.youtube.com/watch?v=O0LbLATVboU&t=320s.

 

However, I face some errors when I want to choose some value in a matrix. The error shown in the figure below pops up. 

Error: This array index is invalid. The index must be an integer, not less than ORIGIN, and not greater then the last element.

 

Can you help me? 

 

Note: I attached the Mathcad and Excel files.

Yunus_Demirol_0-1693233167983.png

 

 

 

 

ACCEPTED SOLUTION

Accepted Solutions

Hi,

Here is a plot of both original data expressed as dots and function defined by line.

Important has a range defined by "range",  It is not a variable but an index.

Important has a column vector variable called "x" you can use.

Zero is the first element index by default unless you set ORIGIN worksheet variable

Capture.JPG

View solution in original post

6 REPLIES 6
Cornel
19-Tanzanite
(To:Yunus_Demirol)

Cornel_0-1693235099846.png

 

Hi,

Here is a plot of both original data expressed as dots and function defined by line.

Important has a range defined by "range",  It is not a variable but an index.

Important has a column vector variable called "x" you can use.

Zero is the first element index by default unless you set ORIGIN worksheet variable

Capture.JPG

Thank you, it was helpful. 🙂 I appreciated it.

Thank you, it was helpful. I appreciated it. 🙂

There is a system variable ORIGIN which either can be set via the menu or simply like any normal variable by typing ORIGIN:=....

This system variable tells Prime what the index of the first element of a vector should be. By default this variable is set to 0, but the sheet in the video seems to have it changed to ORIGIN:=1.

"Data" is a two column matrix and as in your sheet the default value of ORIGIN=1 has not been changed, the column numbers are 0 and 1. This is the reason you get the error when you try to access column number 2 of Data because this would be the third column and it does not exist.

Solution was already shown in the pictures of Terry and Cornel - simply use the indices 0 and 1 instead of 1 and 2 when you define the vectors "Adata" and "Bdata".

Of yourse you could also change the value of ORIGIN from the default 0 to 1 so you could use the indices shown in the video unchanged.

Thank you, it was helpful. 🙂 I appreciated it. I didn't know the origin, but now I got it.

Announcements

Top Tags