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

Handling and Evaluating imported Excel matrix in Mathcad Prime 3.0

xyz123
12-Amethyst

Handling and Evaluating imported Excel matrix in Mathcad Prime 3.0

Dear all,

 

i would like to evaluate an imported matrix from excel. My Prime 3.0 sheet is attached.

 

Basically what I have:

I create a lookup table in mathcad where every row represents a  component, in this case a MOSFET.

Every column represents the corresponding parameters of the component.

I can evaluate row by row with any equation.

By doing this I can obtain for example as a result an array, for example an array with the calculated losses for each MOSFET. So far so good.

 

What I need:

Now I need some kind of programming or searching command in mathcad, where I can find all the indicies of lets say an for which a special searching condition = true.

 

For example my result array:

 

Losses = [100mW, 100mW, 70mW, 80mW, 100mW]

 

The goal is to find all indizies where Losses < 100mW = true .

 

Now the imported excel matrix can be quite large and confusing.

With the indizies, which were obtained before, I want to edit the imported excel matrix, that ONLY the corresponding rows are shown in a new matrix / array...

 

In other words: The imported matrix may have 95% trash values which are not suited for a given searching condition. Only a small amount of rows is interesting and shall be displayed in a new matrix.

 

Best regards

4 REPLIES 4
tietjee
15-Moonstone
(To:xyz123)

I have a couple of comments on your program.  It is not clear how you reading in the Excel worksheet.  I would recommend using the READEXCEL function.  The function will automatically fill empty cells with NaN.  There is also an option to have an alternate value.  The READEXCEL stops when it gets to an empty row, unless instructed otherwise.

 

Think about using the "lookup" functions to find values of interest.  There is an option for less than.  

 

Cheers and I hope this helps.

Fred_Kohlhepp
23-Emerald I
(To:xyz123)

The command you're looking for is "match".

Fred_Kohlhepp_0-1612297473813.png

match will return the indices of all of the rows that satisfy the qualifier (in this case "less than or equal to".)  My Prime 6.0 Express will not help you with 3.0.

Werner_E
25-Diamond I
(To:xyz123)

Would this help?

Werner_E_0-1612307046105.png

The "match" command finds the indices of all values in P.loss which do NOT meet the given condition (which are greater than 100 mW) and then "trim" deletes the corresponding rows in matrix A.

xyz123
12-Amethyst
(To:xyz123)

Hello All,

 

thank you very much, that is what I was looking for! 💪

 

Announcements

Top Tags