Who rated this article

Showing results for 
Search instead for 
Do you mean 

Set Matrix Center Snippet

by on ‎12-09-2015 11:52 AM - edited on ‎02-24-2020 04:51 AM by Community Manager (1,329 Views)

Download model


This model demonstrates how to change the center value in a matrix. The model is a snippet and is intended to be used as part of a workflow (placed into a larger model) and, as such, does not have input/output port operators.


Provide the 'New Value' port of the 'Set Center Value' submodel with the desired value, enter a filename for the output matrix that will have this new center value, and you're done. The snippet will take whatever input matrix has been selected for Custom Matrix Input, will change the center value to New Value and write the resulting new matrix to Matrix File Output. The Inputs and Outputs can be removed to hook the snippet up into a larger model workflow.


You can see this snippet being used in a larger Model in the Article entitled "Blended Filters". There it is used to initialise another matrix that is the same size as the main matrix selected by the user, but which contains all zeros apart from the center value, which is set to one (via the New Value port shown below).


Set Center Value submodel
Set Matrix Element submodel


Input parameters:

Set Center Value.New Value: the desired center value (Scalar, Table, Matrix, Raster)

Matrix Output.Filename: name of the output matrix


Who rated this article