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

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

Newbie

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 4

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

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).

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

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

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

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

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

Remeber to divide by the units you like saved in the Excel spread sheet.

Announcements