Quantcast
Channel: PTC Community : All Content - PTC Mathcad
Viewing all articles
Browse latest Browse all 3331

Reading an Excel file to an array and then programming issues

$
0
0

Hey guys,

 

I've read two columns of an excel file to a mathcad file that looks something like:

 

0
1

1

a
2b
3c
4d

 

I have a series of equations set up in a program, and i have a while loop set up as:

 

{{While (b[a,0 < f(x))

     {{a=a+1    

{{b[a,1

 

Where b represents the array made from the excel file and a's initial value is zero. I want it to read the value of column zero and if the data from the function doesn't match the value in the current row, I want the program to loop and read the next row. When the value from the equation matches the value from the array, I want the program to return the corresponding value from the same row in column 1.

 

It keeps returning an error message saying "This array index is invalid. The index must be an integer, not less than the ORIGIN, and not greater than the last element." And there is a red box around the a,0 in b[a,0.

 

Any help or advice here would be greatly appreciated!


Viewing all articles
Browse latest Browse all 3331

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>