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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

XL Storage

MikeArmstrong
5-Regular Member

XL Storage

I am trying to get an Excel storage object to display results as in the attached sheet.

Tom Gutman created the simple function which enables a range to be written/read. But I can't seem to be able to get the function to display a simple vector in the excel component.


Regards

Mike
7 REPLIES 7

On 1/15/2010 11:06:42 AM, Armo wrote:
>I am trying to get an Excel
>storage object to display
>results as in the attached
>sheet.
>
>"Not sure why they are displayed like this".
>
>Regards
>
>Mike
__________________

The empty XLS are made NaN and displayed 0. Maybe you just need to read/write XLS globally, i.e: peak/poke ... work in Mathcad and spool back to XLS. Once read from XLS, and if you need NaN, force in Mathcad. The way it shows seems all correct, but NaN is not equal to 0 !

jmG



MikeArmstrong
5-Regular Member
(To:ptc-1368288)

Not sure I understand what you mean. At the moment the XL function will only display an Array correctly.

Regards

Mike

The shape of the specified range and the shape of the passed array should match. Here you have a range that is a 3x3 square and an array that is a 5x1 column vector. Don't do that.
__________________
� � � � Tom Gutman
MikeArmstrong
5-Regular Member
(To:TomGutman)

On 1/15/2010 3:31:55 PM, Tom_Gutman wrote:

>Here you have a range that is
>a 3x3 square and an array that
>is a 5x1 column vector. Don't
>do that.

But if the range is change to say B1:B5 the first value in the column vector is displayed 5 times.


Regards

Mike

Essentially a bug in Mathcad's implementation. If one of the dimensions of the data array is one, the remaining dimension, whether the first or the second, is arrayed along Excel columns rather than matching the shape of the data.

Here's a version of the Excel storage component that does it's own indexing so as to properly match shapes.
__________________
� � � � Tom Gutman
MikeArmstrong
5-Regular Member
(To:TomGutman)

Cheers Tom much appreciated.

So the major change in your worksheets was the script?

Regards

Mike

The only functional change was the script. The rest just added some test cases for row and column vectors.
__________________
� � � � Tom Gutman
Top Tags