Skip to main content
5-Regular Member
Aug 16, 2014 7:21 AM UTC
Question

Stripping Units from Mathcad variables (e.g., for export to csv files)

Hi All

I enjoy the units features in Mathcad but find not being able to export them to excel or csv files frustrating. Is there a *simple* way to strip units from a mathcad variable array or matrix in preparation for export via WRITECSV for example?

Thanks Much

Bill

4 replies

Werner_E
25-Diamond I
Aug 16, 2014 8:26 AM UTC

Bill Capehart wrote:

Hi All

I enjoy the units features in Mathcad but find not being able to export them to excel or csv files frustrating. Is there a *simple* way to strip units from a mathcad variable array or matrix in preparation for export via WRITECSV for example?

Thanks Much

Bill

Simply divide the variable by its unit.

You may also use the function UnitsOf(variablename) or SIUnitsOf(variablename).

Translate
24-Ruby IV
Aug 17, 2014 5:28 AM UTC

Werner Exinger wrote:

Simply divide the variable by its unit.

You may also use the function UnitsOf(variablename) or SIUnitsOf(variablename).

Excel does it itself

ExcelUnits.png

Translate
Werner_E
25-Diamond I
Aug 17, 2014 8:13 AM UTC

But using the Excel component doesn't export the data to a file.

You could use the output of the component just to strip the units and then write the unitless data via WRITEEXCEl or WRITECSV, but that would be like taking a sledgehammer to crack a nut compared to simply dividing by the unit.

Of course you could double cick the component and manually chose "save file" from within Excel, but that wouldn't be automatic and a bit awkward, too.

So I guess dividing the matrix which should be written to a file by the desired unit will be the best approach.

1.png

If you use a matrix with elements of different dimensions in Prime, you will have to vectorize the division.

2.png

Translate