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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

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

Bill_Capehart
5-Regular Member

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

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

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

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

tietjee
15-Moonstone
(To:Werner_E)

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

Announcements

Top Tags