Skip to main content
1-Visitor
March 10, 2019
Solved

Returning a symbolic matrix from a Custom Function

  • March 10, 2019
  • 2 replies
  • 1710 views

I want to do a custom function that receives a file name, and reads a matrix of symbolics, and return this symbolic matrix do Mathcad.  For example, my file may contain the following 3x3 matrix:

 

a                        b+c8           k/e3

0                        5+f4            0

(6*a)/(b+c)        0                 1

 

numbers are numbers, symbols are k, a, e3, c8, etc.

 

Anyone knows how to do it?

Best answer by LucMeekes

You're not the first to ask, and probably not the last either.

Consider this function:

LM_20190310_SymbolMatrix.png

As you can see, it is possible in Mathcad,

BUT... you need Mathcad 11.

It is the only version that has a sufficiently large undocumented access to its symbolic processor, allowing the String2Expression() function to operate by its name.

 

Luc

2 replies

25-Diamond I
March 10, 2019

I guess that you are out of luck and that its not possible to achieve in Mathcad what you are asking for.

What you read in from a file would be a text and it would be necessary to create variable names based on that text. Unfortunately we cannot create variable names in Mathcad other than typing them in manually.

LucMeekes23-Emerald IVAnswer
23-Emerald IV
March 10, 2019

You're not the first to ask, and probably not the last either.

Consider this function:

LM_20190310_SymbolMatrix.png

As you can see, it is possible in Mathcad,

BUT... you need Mathcad 11.

It is the only version that has a sufficiently large undocumented access to its symbolic processor, allowing the String2Expression() function to operate by its name.

 

Luc