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.

Featured Replies

This is my first effort at Custom Functions so be kind.

I am working with the example file Matrix Math from

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

and some of the functions below are from that file. I have defined a custom function AddRow which simply adds a new row into a matrix at a given position (the position is the row number of the vector in the new matrix. AddRow is defined as

AddRow(matrix,row,vector) =

Case(

Cols(matrix) ≠ Cols(vector) or Int(row) ≠ row or row > Rows(matrix) + 1 or row ≤ 0;matrix;

LeftValues(matrix;row - 1) & vector & If(row ≠ Rows(matrix) + 1; "¶";"") & RightValues(matrix;Rows(matrix) - row + 1 ))

Here vector is a list in the form v = "a1; a2; ... ; an;" Cols(v) = n and matrix is a value list of vectors A = v1 & "¶" & v2 & "¶" &... &vm) all with the same number of columns and Rows(A) = m.

THis function works fine.I need a similar function AddCol to add a column to a matrix in a given position and it seemed to me that the obvious thing to do was to use Transpose and AddRow.

So I am trying to add a column whose elements are from a given (row) vector

AddCol(matrix;col;vector) =

Transpose(AddRow(Transpose(matrix);col;vector))

OK here is the problem. AddCol does not work FMP gives me the ? However, if I write down the formula for AddCol above and Evaluate it it does work. Am I missing something about custom functions calling custom functions?

Any help appreciated.

  • Author

Ignore this post - I don't know what I was doing when I tested it but it works fine now.

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.