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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

data from Excel component acts weird

SteenGroðe
6-Contributor

data from Excel component acts weird

I have imported a column from Excel via the component interface. In version 11.2 it partly act as a vector partly acts as something different leaving error messages in a least one case.

In v14 is does the same but the error message.

Am I just getting old or what do I miss in this case?


Steen Gro�e
2 REPLIES 2

Error message isn't about imported data, it is about L in the Locate procedure. Change L (col i) <- m with L sub i <- m in the for loop and works.

Regards. Alvaro.

The complaint is about m not being a vector. The construct x<i>←y requires that y be a vector, and that, if x is an array, it have the same number of rows as x. In MC11 the error trace seems to be broken for this case.

In MC14 you never execute the assignment, as NaN does not compare equal to NaN. You must use the IsNaN function to test for NaNs. However MC14 does tolerate the assignment of a scalar, treating it as a one element vector.

To fix it:

In MC11: use an array constructor to assign the one element vector (m) rather than the scalar m.

In MC14: change the Mm=NaN to IsNaN(Mm). This should be done in MC11, but is not necessary there.
__________________
� � � � Tom Gutman
Top Tags