# cost_function_matrix > Build matrices for cost function --- ## Description cost_function_matrix builds matrices for calculating the cost. ## Syntax ```matlab matrices = cost_function_matrix(scenario) ``` ## Input Arguments | Name | Type | Description | |------|------|--------------| | `scenario` | *Scenario object* | Scenario object that specifies the optimization problem. | ## Output Arguments | Name | Type | Description | |------|------|--------------| | `matrices` | *struct* | Structure containing matrices for cost calculation. |