Main Content

c Coefficient for specifyCoefficients

Overview of the c Coefficient

This topic describes how to write the coefficient c in equations such as

m2ut2+dut·(cu)+au=f

The topic applies to the recommended workflow for including coefficients in your model using specifyCoefficients.

For 2-D systems, c is a tensor with 4N2 elements. For 3-D systems, c is a tensor with 9N2 elements. For a definition of the tensor elements, see Definition of the c Tensor Elements. N is the number of equations, see Equations You Can Solve Using PDE Toolbox.

To write the coefficient c for inclusion in the PDE model via specifyCoefficients, give c as either of the following:

  • If c is constant, give a column vector representing the elements in the tensor.

  • If c is not constant, give a function handle. The function must be of the form

    ccoeffunction(location,state)

    solvepde or solvepdeeig pass the location and state structures to ccoeffunction. The function must return a matrix of size N1-by-Nr, where:

    • N1 is the length of the vector representing the c coefficient. There are several possible values of N1, detailed in Some c Vectors Can Be Short. For 2-D geometry, 1 ≤ N1 ≤ 4N2, and for 3-D geometry, 1 ≤ N1 ≤ 9N2.

    • Nr is the number of points in the location that the solver passes. Nr is equal to the length of the location.x or any other location field. The function should evaluate c at these points.

Definition of the c Tensor Elements

For 2-D systems, the notation (cu) represents an N-by-1 matrix with an (i,1)-component

j=1N(xci,j,1,1x+xci,j,1,2y+yci,j,2,1x+yci,j,2,2y)uj

For 3-D systems, the notation (cu) represents an N-by-1 matrix with an (i,1)-component

j=1N(xci,j,1,1x+xci,j,1,2y+xci,j,1,3z)uj+j=1N(yci,j,2,1x+yci,j,2,2y+yci,j,2,3z)uj+j=1N(zci,j,3,1x+zci,j,3,2y+zci,j,3,3z)uj

All representations of the c coefficient begin with a “flattening” of the tensor to a matrix. For 2-D systems, the N-by-N-by-2-by-2 tensor flattens to a 2N-by-2N matrix, where the matrix is logically an N-by-N matrix of 2-by-2 blocks.

(c(1,1,1,1)c(1,1,1,2)c(1,2,1,1)c(1,2,1,2)c(1,N,1,1)c(1,N,1,2)c(1,1,2,1)c(1,1,2,2)c(1,2,2,1)c(1,2,2,2)c(1,N,2,1)c(1,N,2,2)c(2,1,1,1)c(2,1,1,2)c(2,2,1,1)c(2,2,1,2)c(2,N,1,1)c(2,N,1,2)c(2,1,2,1)c(2,1,2,2)c(2,2,2,1)c(2,2,2,2)c(2,N,2,1)c(2,N,2,2)c(N,1,1,1)c(N,1,1,2)c(N,2,1,1)c(N,2,1,2)c(N,N,1,1)c(N,N,1,2)c(N,1,2,1)c(N,1,2,2)c(N,2,2,1)c(N,2,2,2)c(N,N,2,1)c(N,N,2,2))

For 3-D systems, the N-by-N-by-3-by-3 tensor flattens to a 3N-by-3N matrix, where the matrix is logically an N-by-N matrix of 3-by-3 blocks.

(c(1,1,1,1)c(1,1,1,2)c(1,1,1,3)c(1,2,1,1)c(1,2,1,2)c(1,2,1,3)c(1,N,1,1)c(1,N,1,2)c(1,N,1,3)c(1,1,2,1)c(1,1,2,2)c(1,1,2,3)c(1,2,2,1)c(1,2,2,2)c(1,2,2,3)c(1,N,2,1)c(1,N,2,2)c(1,N,2,3)c(1,1,3,1)c(1,1,3,2)c(1,1,3,3)c(1,2,3,1)c(1,2,3,2)c(1,2,3,3)c(1,N,3,1)c(1,N,3,2)c(1,N,3,3)c(2,1,1,1)c(2,1,1,2)c(2,1,1,3)c(2,2,1,1)c(2,2,1,2)c(2,2,1,3)c(2,N,1,1)c(2,N,1,2)c(2,N,1,3)c(2,1,2,1)c(2,1,2,2)c(2,1,2,3)c(2,2,2,1)c(2,2,2,2)c(2,2,2,3)c(2,N,2,1)c(2,N,2,2)c(2,N,2,3)c(2,1,3,1)c(2,1,3,2)c(2,1,3,3)c(2,2,3,1)c(2,2,3,2)c(2,2,3,3)c(2,N,3,1)c(2,N,3,2)c(2,N,3,3)c(N,1,1,1)c(N,1,1,2)c(N,1,1,3)c(N,2,1,1)c(N,2,1,2)c(N,2,1,3)c(N,N,1,1)c(N,N,1,2)c(N,N,1,3)c(N,1,2,1)c(N,1,2,2)c(N,1,2,3)c(N,2,2,1)c(N,2,2,2)c(N,2,2,3)c(N,N,2,1)c(N,N,2,2)c(N,N,2,3)c(N,1,3,1)c(N,1,3,2)c(N,1,3,3)c(N,2,3,1)c(N,2,3,2)c(N,2,3,3)c(N,N,3,1)c(N,N,3,2)c(N,N,3,3))

These matrices further get flattened into a column vector. First the N-by-N matrices of 2-by-2 and 3-by-3 blocks are transformed into "vectors" of 2-by-2 and 3-by-3 blocks. Then the blocks are turned into vectors in the usual column-wise way.

The coefficient vector c relates to the tensor c as follows. For 2-D systems,

(c(1)c(3)c(4N+1)c(4N+3)c(4N(N1)+1)c(4N(N1)+3)c(2)c(4)c(4N+2)c(4N+4)c(4N(N1)+2)c(4N(N1)+4)c(5)c(7)c(4N+5)c(4N+7)c(4N(N1)+5)c(4N(N1)+7)c(6)c(8)c(4N+6)c(4N+8)c(4N(N1)+6)c(4N(N1)+8)c(4N3)c(4N1)c(8N3)c(8N1)c(4N23)c(4N21)c(4N2)c(4N)c(8N2)c(8N)c(4N22)c(4N2))

Coefficient c(i,j,k,l) is in row (4N(j–1) + 4i + 2l + k – 6) of the vector c.

For 3-D systems,

(c(1)c(4)c(7)c(9N+1)c(9N+4)c(9N+7)c(9N(N1)+1)c(9N(N1)+4)c(9N(N1)+7)c(2)c(5)c(8)c(9N+2)c(9N+5)c(9N+8)c(9N(N1)+2)c(9N(N1)+5)c(9N(N1)+8)c(3)c(6)c(9)c(9N+3)c(9N+6)c(9N+9)c(9N(N1)+3)c(9N(N1)+6)c(9N(N1)+9)c(10)c(13)c(16)c(9N+10)c(9N+13)c(9N+16)c(9N(N1)+10)c(9N(N1)+13)c(9N(N1)+16)c(11)c(14)c(17)c(9N+11)c(9N+14)c(9N+17)c(9N(N1)+11)c(9N(N1)+14)c(9N(N1)+17)c(12)c(15)c(18)c(9N+12)c(9N+15)c(9N+18)c(9N(N1)+12)c(9N(N1)+15)c(9N(N1)+18)c(9N8)c(9N5)c(9N2)c(18N8)c(18N5)c(18N2)c(9N28)c(9N25)c(9N22)c(9N7)c(9N4)c(9N1)c(18N7)c(18N4)c(18N1)c(9N27)c(9N24)c(9N21)c(9N6)c(9N3)c(9N)c(18N6)c(18N3)c(18N)c(9N26)c(9N23)c(9N2))

Coefficient c(i,j,k,l) is in row (9N(j–1) + 9i + 3l + k – 12) of the vector c.

Some c Vectors Can Be Short

Often, your tensor c has structure, such as symmetric or block diagonal. In many cases, you can represent c using a smaller vector than one with 4N2 components for 2-D or 9N2 components for 3-D. The following sections give the possibilities.

2-D Systems

Scalar c, 2-D Systems.  The software interprets a scalar c as a diagonal matrix, with c(i,i,1,1) and c(i,i,2,2) equal to the scalar, and all other entries 0.

(c000000c000000c000000c000000c000000c)

Two-Element Column Vector c, 2-D Systems.  The software interprets a two-element column vector c as a diagonal matrix, with c(i,i,1,1) and c(i,i,2,2) as the two entries, and all other entries 0.

(c(1)000000c(2)000000c(1)000000c(2)000000c(1)000000c(2))

Three-Element Column Vector c, 2-D Systems.  The software interprets a three-element column vector c as a symmetric block diagonal matrix, with c(i,i,1,1) = c(1), c(i,i,2,2) = c(3), and c(i,i,1,2) = c(i,i,2,1) = c(2).

(c(1)c(2)0000c(2)c(3)000000c(1)c(2)0000c(2)c(3)000000c(1)c(2)0000c(2)c(3))

Four-Element Column Vector c, 2-D Systems.  The software interprets a four-element column vector c as a block diagonal matrix.

(c(1)c(3)0000c(2)c(4)000000c(1)c(3)0000c(2)c(4)000000c(1)c(3)0000c(2)c(4))

N-Element Column Vector c, 2-D Systems.  The software interprets an N-element column vector c as a diagonal matrix.

(c(1)000000c(1)000000c(2)000000c(2)000000c(N)000000c(N))

Caution

If N = 2, 3, or 4, the 2-, 3-, or 4-element column vector form takes precedence over the N-element form. For example, if N = 3, and you have a c matrix of the form

(c1000000c1000000c2000000c2000000c3000000c3)

you cannot use the N-element form of c. Instead, you must use the 2N-element form. If you give c as the vector [c1;c2;c3], the software interprets c as a 3-element form:

(c1c20000c2c3000000c1c20000c2c3000000c1c20000c2c3)

Instead, use the 2N-element form [c1;c1;c2;c2;c3;c3].

2N-Element Column Vector c, 2-D Systems.  The software interprets a 2N-element column vector c as a diagonal matrix.

(c(1)000000c(2)000000c(3)000000c(4)000000c(2N1)000000c(2N))

Caution

If N = 2, the 4-element form takes precedence over the 2N-element form. For example, if your c matrix is

(c10000c20000c30000c4)

you cannot give c as [c1;c2;c3;c4], because the software interprets this vector as the 4-element form

(c1c300c2c40000c1c300c2c4)

Instead, use the 3N-element form [c1;0;c2;c3;0;c4] or the 4N-element form [c1;0;0;c2;c3;0;0;c4].

3N-Element Column Vector c, 2-D Systems.  The software interprets a 3N-element column vector c as a symmetric block diagonal matrix.

(c(1)c(2)0000c(2)c(3)000000c(4)c(5)0000c(5)c(6)000000c(3N2)c(3N1)0000c(3N1)c(3N))

Coefficient c(i,j,k,l) is in row (3i + k + l – 4) of the vector c.

4N-Element Column Vector c, 2-D Systems.  The software interprets a 4N-element column vector c as a block diagonal matrix.

(c(1)c(3)0000c(2)c(4)000000c(5)c(7)0000c(6)c(8)000000c(4N3)c(4N1)0000c(4N2)c(4N))

Coefficient c(i,j,k,l) is in row (4i + 2l + k – 6) of the vector c.

2N(2N+1)/2-Element Column Vector c, 2-D Systems.  The software interprets a 2N(2N+1)/2-element column vector c as a symmetric matrix. In the following diagram, • means the entry is symmetric.

(c(1)c(2)c(4)c(6)c((N1)(2N1)+1)c((N1)(2N1)+3)c(3)c(5)c(7)c((N1)(2N1)+2)c((N1)(2N1)+4)c(8)c(9)c((N1)(2N1)+5)c((N1)(2N1)+7)c(10)c((N1)(2N1)+6)c((N1)(2N1)+8)c(N(2N+1)2)c(N(2N+1)1)c(N(2N+1)))

Coefficient c(i,j,k,l), for i < j, is in row (2j2 – 3j + 4i + 2l + k – 5) of the vector c. For i = j, coefficient c(i,j,k,l) is in row (2i2 + i + l + k – 4) of the vector c.

4N2-Element Column Vector c, 2-D Systems.  The software interprets a 4N2-element column vector c as a matrix.

(c(1)c(3)c(4N+1)c(4N+3)c(4N(N1)+1)c(4N(N1)+3)c(2)c(4)c(4N+2)c(4N+4)c(4N(N1)+2)c(4N(N1)+4)c(5)c(7)c(4N+5)c(4N+7)c(4N(N1)+5)c(4N(N1)+7)c(6)c(8)c(4N+6)c(4N+8)c(4N(N1)+6)c(4N(N1)+8)c(4N3)c(4N1)c(8N3)c(8N1)c(4N23)c(4N21)c(4N2)c(4N)c(8N2)c(8N)c(4N22)c(4N2))

Coefficient c(i,j,k,l) is in row (4N(j–1) + 4i + 2l + k – 6) of the vector c.

3-D Systems

Scalar c, 3-D Systems.  The software interprets a scalar c as a diagonal matrix, with c(i,i,1,1), c(i,i,2,2), and c(i,i,3,3) equal to the scalar, and all other entries 0.

(c000000000c000000000c000000000c000000000c000000000c000000000c000000000c000000000c)

Three-Element Column Vector c, 3-D Systems.  The software interprets a three-element column vector c as a diagonal matrix, with c(i,i,1,1), c(i,i,2,2), and c(i,i,3,3) as the three entries, and all other entries 0.

(c(1)000000000c(2)000000000c(3)000000000c(1)000000000c(2)000000000c(3)000000000c(1)000000000c(2)000000000c(3))

Six-Element Column Vector c, 3-D Systems.  The software interprets a six-element column vector c as a symmetric block diagonal matrix, with

c(i,i,1,1) = c(1)
c(i,i,2,2) = c(3)
c(i,i,1,2) = c(i,i,2,1) = c(2)
c(i,i,1,3) = c(i,i,3,1) = c(4)
c(i,i,2,3) = c(i,i,3,2) = c(5)
c(i,i,3,3) = c(6).

In the following diagram, • means the entry is symmetric.

(c(1)c(2)c(4)000000c(3)c(5)000000c(6)000000000c(1)c(2)c(4)000000c(3)c(5)000000c(6)000000000c(1)c(2)c(4)000000c(3)c(5)000000c(6))

Nine-Element Column Vector c, 3-D Systems.  The software interprets a nine-element column vector c as a block diagonal matrix.

(c(1)c(4)c(7)000000c(2)c(5)c(8)000000c(3)c(6)c(9)000000000c(1)c(4)c(7)000000c(2)c(5)c(8)000000c(3)c(6)c(9)000000000c(1)c(4)c(7)000000c(2)c(5)c(8)000000c(3)c(6)c(3))

N-Element Column Vector c, 3-D Systems.  The software interprets an N-element column vector c as a diagonal matrix.

(c(1)000000000c(1)000000000c(1)000000000c(2)000000000c(2)000000000c(2)000000000c(N)000000000c(N)000000000c(N))

Caution

If N = 3, 6, or 9, the 3-, 6-, or 9-element column vector form takes precedence over the N-element form. For example, if N = 3, and you have a c matrix of the form

(c(1)000000000c(1)000000000c(1)000000000c(2)000000000c(2)000000000c(2)000000000c(3)000000000c(3)000000000c(3))

you cannot use the N-element form of c. If you give c as the vector [c1;c2;c3], the software interprets c as a 3-element form:

(c(1)000000000c(2)000000000c(3)000000000c(1)000000000c(2)000000000c(3)000000000c(1)000000000c(2)000000000c(3))

Instead, use one of these forms:

  • 6N-element form — [c1;0;c1;0;0;c1;c2;0;c2;0;0;c2;c3;0;c3;0;0;c3]

  • 9N-element form — [c1;0;0;0;c1;0;0;0;c1;c2;0;0;0;c2;0;0;0;c2;c3;0;0;0;c3;0;0;0;c3]

3N-Element Column Vector c, 3-D Systems.  The software interprets a 3N-element column vector c as a diagonal matrix.

(c(1)000000000c(2)000000000c(3)000000000c(4)000000000c(5)000000000c(6)000000000c(3N2)000000000c(3N1)000000000c(3N))

Caution

If N = 3, the 9-element form takes precedence over the 3N-element form. For example, if your c matrix is

(c(1)000000000c(2)000000000c(3)000000000c(4)000000000c(5)000000000c(6)000000000c(7)000000000c(8)000000000c(9))

you cannot give c as [c1;c2;c3;c4;c5;c6;c7;c8;c9], because the software interprets this vector as the 9-element form

(c(1)c(4)c(7)000000c(2)c(5)c(8)000000c(3)c(6)c(9)000000000c(1)c(4)c(7)000000c(2)c(5)c(8)000000c(3)c(6)c(9)000000000c(1)c(4)c(7)000000c(2)c(5)c(8)000000c(3)c(6)c(3))

Instead, use one of these forms:

  • 6N-element form — [c1;0;c2;0;0;c3;c4;0;c5;0;0;c6;c7;0;c8;0;0;c9]

  • 9N-element form — [c1;0;0;0;c2;0;0;0;c3;c4;0;0;0;c5;0;0;0;c6;c7;0;0;0;c8;0;0;0;c9]

6N-Element Column Vector c, 3-D Systems.  The software interprets a 6N-element column vector c as a symmetric block diagonal matrix. In the following diagram, • means the entry is symmetric.

(c(1)c(2)c(4)000000c(3)c(5)000000c(6)000000000c(7)c(8)c(10)000000c(9)c(11)000000c(12)000000000c(6N5)c(6N4)c(6N2)000000c(6N3)c(6N1)000000c(6N))

Coefficient c(i,j,k,l) is in row (6i + k + 1/2l(l–1) – 6) of the vector c.

9N-Element Column Vector c, 3-D Systems.  The software interprets a 9N-element column vector c as a block diagonal matrix.

(c(1)c(4)c(7)000000c(2)c(5)c(8)000000c(3)c(6)c(9)000000000c(10)c(13)c(16)000000c(11)c(14)c(17)000000c(12)c(15)c(18)000000000c(9N8)c(9N5)c(9N2)000000c(9N7)c(9N4)c(9N1)000000c(9N6)c(9N3)c(9N))

Coefficient c(i,j,k,l) is in row (9i + 3l + k – 12) of the vector c.

3N(3N+1)/2-Element Column Vector c, 3-D Systems.  The software interprets a 3N(3N+1)/2-element column vector c as a symmetric matrix. In the following diagram, • means the entry is symmetric.

(c(1)c(2)c(4)c(7)c(10)c(13)c(3(N1)(3(N1)+1)/2+1c(3(N1)(3(N1)+1)/2+4c(3(N1)(3(N1)+1)/2+7c(3)c(5)c(8)c(11)c(14)c(3(N1)(3(N1)+1)/2+2c(3(N1)(3(N1)+1)/2+5c(3(N1)(3(N1)+1)/2+8c(6)c(9)c(12)c(15)c(3(N1)(3(N1)+1)/2+3c(3(N1)(3(N1)+1)/2+6c(3(N1)(3(N1)+1)/2+9c(16)c(17)c(19)c(3(N1)(3(N1)+1)/2+10c(3(N1)(3(N1)+1)/2+13c(3(N1)(3(N1)+1)/2+16c(18)c(20)c(3(N1)(3(N1)+1)/2+11c(3(N1)(3(N1)+1)/2+14c(3(N1)(3(N1)+1)/2+17c(21)c(3(N1)(3(N1)+1)/2+12c(3(N1)(3(N1)+1)/2+15c(3(N1)(3(N1)+1)/2+18c(3N(3N+1)/25)c(3N(3N+1)/24)c(3N(3N+1)/22)c(3N(3N+1)/23)c(3N(3N+1)/21)c(3N(3N+1)/2))

Coefficient c(i,j,k,l), for i < j, is in row (9(j–1)(j–2)/2 + 6(j–1) + 9i + 3l + k – 12) of the vector c. For i = j, coefficient c(i,j,k,l) is in row (9(i–1)(i–2)/2 + 15(i–1) + 1/2l(l–1) + k) of the vector c.

9N2-Element Column Vector c, 3-D Systems.  The software interprets a 9N2-element column vector c as a matrix.

(c(1)c(4)c(7)c(9N+1)c(9N+4)c(9N+7)c(9N(N1)+1)c(9N(N1)+4)c(9N(N1)+7)c(2)c(5)c(8)c(9N+2)c(9N+5)c(9N+8)c(9N(N1)+2)c(9N(N1)+5)c(9N(N1)+8)c(3)c(6)c(9)c(9N+3)c(9N+6)c(9N+9)c(9N(N1)+3)c(9N(N1)+6)c(9N(N1)+9)c(10)c(13)c(16)c(9N+10)c(9N+13)c(9N+16)c(9N(N1)+10)c(9N(N1)+13)c(9N(N1)+16)c(11)c(14)c(17)c(9N+11)c(9N+14)c(9N+17)c(9N(N1)+11)c(9N(N1)+14)c(9N(N1)+17)c(12)c(15)c(18)c(9N+12)c(9N+15)c(9N+18)c(9N(N1)+12)c(9N(N1)+15)c(9N(N1)+18)c(9N8)c(9N5)c(9N2)c(18N8)c(18N5)c(18N2)c(9N28)c(9N25)c(9N22)c(9N7)c(9N4)c(9N1)c(18N7)c(18N4)c(18N1)c(9N27)c(9N24)c(9N21)c(9N6)c(9N3)c(9N)c(18N6)c(18N3)c(18N)c(9N26)c(9N23)c(9N2))

Coefficient c(i,j,k,l) is in row (9N(j–1) + 9i + 3l + k – 12) of the vector c.

Functional Form

If your c coefficient is not constant, represent it as a function of the form

ccoeff = ccoeffunction(location,state)

Pass the coefficient to specifyCoefficients as a function handle, such as

specifyCoefficients(model,"c",@ccoeffunction,...)

solvepde or solvepdeeig compute and populate the data in the location and state structure arrays and pass this data to your function. You can define your function so that its output depends on this data. You can use any names instead of location and state, but the function must have exactly two arguments. To use additional arguments in your function, wrap your function (that takes additional arguments) with an anonymous function that takes only the location and state arguments. For example:

ccoeff = ...
@(location,state) myfunWithAdditionalArgs(location,state,arg1,arg2...)
specifyCoefficients(model,"c",ccoeff,...
  • location is a structure with these fields:

    • location.x

    • location.y

    • location.z

    • location.subdomain

    The fields x, y, and z represent the x-, y-, and z- coordinates of points for which your function calculates coefficient values. The subdomain field represents the subdomain numbers. The location fields are row vectors.

  • state is a structure with these fields:

    • state.u

    • state.ux

    • state.uy

    • state.uz

    • state.time

    The state.u field represents the current value of the solution u. The state.ux, state.uy, and state.uz fields are estimates of the solution’s partial derivatives (∂u/∂x, ∂u/∂y, and ∂u/∂z) at the corresponding points of the location structure. The solution and gradient estimates are N-by-Nr matrices. The state.time field is a scalar representing time for time-dependent models.

Your function must return a matrix of size N1-by-Nr, where:

  • N1 is the number of coefficients you pass to the solver. There are several possible values of N1, detailed in Some c Vectors Can Be Short. For 2-D geometry, 1 ≤ N1 ≤ 4N2, and for 3-D geometry, 1 ≤ N1 ≤ 9N2.

  • Nr is the number of points in the location that the solver passes. Nr is equal to the length of the location.x or any other location field. The function should evaluate c at these points.

For example, suppose N = 3, and you have 2-D geometry. Suppose your c matrix is of the form

c=[12281+x2+y2u(2)1+u(1)2+u(3)2u(2)1+u(1)2+u(3)21+x2+y2s1(x,y)11s1(x,y)]

where unlisted elements are zero. Here s1(x,y) is 5 in subdomain 1, and is 10 in subdomain 2.

This c is a symmetric, block-diagonal matrix with different coefficients in each block. So it is natural to represent c as a 3N-Element Column Vector c, 2-D Systems:

(c(1)c(2)0000c(2)c(3)000000c(4)c(5)0000c(5)c(6)000000c(3N2)c(3N1)0000c(3N1)c(3N))

For that form, the following function is appropriate.

function cmatrix = ccoeffunction(location,state)

n1 = 9;
nr = numel(location.x);
cmatrix = zeros(n1,nr);
cmatrix(1,:) = ones(1,nr);
cmatrix(2,:) = 2*ones(1,nr);
cmatrix(3,:) = 8*ones(1,nr);
cmatrix(4,:) = 1+location.x.^2 + location.y.^2;
cmatrix(5,:) = state.u(2,:)./(1 + state.u(1,:).^2 + state.u(3,:).^2);
cmatrix(6,:) = cmatrix(4,:);
cmatrix(7,:) = 5*location.subdomain;
cmatrix(8,:) = -ones(1,nr);
cmatrix(9,:) = cmatrix(7,:);

To include this function as your c coefficient, pass the function handle @ccoeffunction:

specifyCoefficients(model,"c",@ccoeffunction,...

Related Topics