Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Need Matrix Mathematics

Featured Replies

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.

It's been a while since I've worked with matricies. A matrix is essentially a multi-dimensional array, correct? Can you give examples of what you would want to see.

  • Author

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.

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

I would like to know why and how you would use a matrix in a database. It seems counter to the first normal form of relational database design.

  • Author

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.

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.

  • Author

The Shadow:

Very good--it makes sense to use custom functions for this.

  • Author

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

I'm not seeing that problem. I added a new record with:

MatrixMultiply( A; B )

with A: "1; 0; 5;

I have updated the example on my website to incorporate a few fixes to some of the routines that were leaving extra elements around in some cases. I also changed records to be examples, with short descriptions of the public functions.

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

  • Author

The Shadow:

I've tried several different matrix multiplicands; the custom function gives the wrong 1,1 element in each case.

  • Author

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.

  • 2 weeks later...

If you're working with Unix then of course the Mac is a perfect fit because it Is Unix. The Satimage capabailities are amazing.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.