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

Returning a symbolic matrix from a Custom Function

SOLVED
Highlighted

Returning a symbolic matrix from a Custom Function

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?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Returning a symbolic matrix from a Custom Function

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 2

Re: Returning a symbolic matrix from a Custom Function

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.

Re: Returning a symbolic matrix from a Custom Function

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