Jump to content
Server Maintenance This Week. ×

Need Matrix Mathematics


This topic is 7197 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I request that FileMaker add a matrix field type so that matrices can be entered and matrix mathematics performed (with new functions). I also request a contains operator and field event trapping. Also, FileMaker should work with Microsoft to use protected memory so that if FileMaker freezes it wouldn't freeze the whole darn machine.

Link to comment
Share on other sites

OK. I'd like one and two-dimensional arrays (I don't think that three-dimensional or higher-dimensional arrays would usually be needed). I'd like to be able to multiply matrix A and vector x and add that to the product of matrix B and vector u, for instance. So, I'd like matrix addition, subtraction, multiplication, powers, inverses, transposes, and also have functions that can work with each element of an array.

Link to comment
Share on other sites

If you can get your hands on a Mac, this is available using AppleScript, via a free Scripting Addition, Satimage, from:

http://www.satimage-software.com

They are into mathematics and graphics. Maybe someone will create a FileMaker plug-in that does this; I've never heard of one. Maybe Visual Basic? (I have no idea)

Here's a some of its dictionary:

creatematrix plain text -- "1": array of 1.0, "x": array of x values, "y": array of y values

ncols integer -- or a list of real with the "x" option, will make an array with identical rows

nrows integer -- or a list of real with the "y" option, will make an array with identical columns

[range a list of real] -- {min,max}

[as type class] -- array of real or matrix, default: array of real

Result: array of real -- or matrix

transpose matrix -- the matrix

Result: matrix -- the transposed matrix

extractarray array of real

[at integer] -- the first item to read or a list of indexes (in which case, the "for", "step" and "blocksize" parameters are not taken into account). 1-based. Default 1

[for integer] -- the number of blocks to read. Default 1

[blocksize integer] -- size of the block to read at each step. blocksize must be smaller than step

[step integer] -- the interval between the beginnings of successive blocks to read. Must be larger than blocksize. Default: blocksize

[as type class] -- default is array of real, you can provide small real or real for 1 item

Result: array of real

evalformula: apply C-like mathematical expressions to arrays of real. Ex: evalformula "a*x^2+y^2" with {a:2.4,x:anarray,y:anotherarray}

evalformula plain text -- the formula to compute

[with a list of real] -- the definition of the variables occurring in the formula.

Result: array of real -- or real

Link to comment
Share on other sites

Fenton:

Thanks, but I work with Windows and UNIX only. I do a lot of matrix programming using MATLAB, Maple, and Mathcad. (I used to use TrueBASIC quite a lot--it had all kinds of matrix manipulations.) It would be nice to be able to do it in FileMaker.

Ralph:

The matrix field type would be just another field type; a calculation involving matrices would be another matrix.

Link to comment
Share on other sites

I can't see matrices ever being added as a field type, I think its too technical.

I added an example to my web page that does some of the easier matrix manipulation as custom functions:

http://www.spf-15.com/fmExamples/

(see Matrix Math)

The matrices are stored as a semi-colon seperated list, ie:

-1; 3.5; 17;

0; 14; 72;

It implements transpose, matrix multiplication with another matrix or a scalar, addition / subtraction of matrices, an identity matrix creator, and various functions to extract rows, columns, or a single element.

No determinant or inverse functions at the moment, those look quite a bit more complex.

Link to comment
Share on other sites

The Shadow:

I finally got around to testing your custom functions. Unfortunately the matrix multiplication routine doesn't work. If I multiply [1 0 5 ; -1 3 2] by [3 3 ; 2 1 ; 1 0] (MATLAB notation) I should get [8 3 ; 5 0]. Your custom function returns [3 3 ; 5 0].

Link to comment
Share on other sites

OOPS: When I was playing with the A or B matrix I was inadvertently leaving off the ";" at the end of the first row (out of habit in working with other computer languages like MATLAB and Maple). With the ";" in place at the end of each row and between each element, your custom function produces the correct result. Thank you very much.

Link to comment
Share on other sites

  • 2 weeks later...

This topic is 7197 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.