Jump to content

Initializing a State Vector


marquisd
 Share

Recommended Posts

I have a state vector where all but one indexed value must be zero. This oddball cannot be zero. I want to initialize it in the Definitions window. Can someone explain how to do this in a general sense? I.e., in general, what if I want to initialize every index with a unique value?


Thanks

Link to comment
Share on other sites

Dave,


From the help file it says:

In order to initialize a State Array, the user should bind the array to a Data Table. When bound, the array size will be initialized from the number of rows and numeric columns in the table, and the array data will be initialized from the data in the table. To bind an array to a table, set the Dimension Type property of the state to 'Matrix From Table' and select the appropriate table from the drop down of the Table Name property.

 

Attached is a sample model that shows that.


Hope that helps.

Init Array State Model.spfx

Link to comment
Share on other sites

×
×
  • Create New...