private void RefreshButton_Click(object sender, EventArgs e)
        {
            int numAdditionalColumns;
            CMatrix m = new CMatrix();
            string sz = CStringUtil.SzForceIntoMatrixDoubleFormat(MatrixTextBox.Text);

            if(m_displayType == MBSDEFAULTS.BITMAPDISPLAYTYPE.INITIAL_BEHAVIOR)
                numAdditionalColumns = 3;
            else
                numAdditionalColumns = 5;


            m.a = CStringUtil.SzMatrixToDouble2DArray(MatrixTextBox.Text);
            while(m.ColumnCount > m_numBehaviorsDefined + numAdditionalColumns)
                m.DeleteColumn(m.ColumnCount-1);
            while(m.ColumnCount < m_numBehaviorsDefined + numAdditionalColumns)
                m.AddColumn();

            MatrixTextBox.Text = m.ConvertToStringB();
            DoneButton.Enabled = true;
            NumTrialsButton.Enabled = true;
            RefreshButton.Enabled = false;
            if(true == (m_szFormatOK = UpdateModel()))
                RunTransitionOverTimeTest(CUtil.CopyMatrix(m));
        }
        private void RefreshButton_Click(object sender, EventArgs e)
        {
            CVector v = new CVector();
            CMatrix m = new CMatrix();
            int ccnt;
            string szTemp;

            szTemp = CStringUtil.SzForceSquareMatrixFormatDouble(BiasTextBox.Text);
            m.a = CStringUtil.SzMatrixToDouble2DArray(szTemp);
            BiasTextBox.Text = m.ConvertToStringA();
            UdateBiasMatrixModeling();

            // Make matrix m into a square matix
            m.a = CStringUtil.SzMatrixToDouble2DArray(BiasTextBox.Text);

            // Determin minimum nuber of columns
            ccnt = m.ColumnCount;
            if(ccnt < m.RowCount)
                ccnt = m.RowCount;
            v.a = CStringUtil.SzVectorToDoubleArray(ProbTurnVectorTextBox.Text);
            if(m_r.type == DIRECTIONMODELTYPE.VECTOR_DIRBIAS && v.columnCount > ccnt)
                ccnt = v.columnCount;

            while(m.RowCount > ccnt)
                m.DeleteRow(m.RowCount-1);
            while(m.RowCount < ccnt)
                m.AddRow();
            while(m.ColumnCount > ccnt)
                m.DeleteColumn(m.ColumnCount-1);
            while(m.ColumnCount < ccnt)
                m.AddColumn();
            BiasTextBox.Text = m.ConvertToStringA();
            UdateBiasMatrixModeling();



            while(v.columnCount > ccnt)
                v.DeleteColumn(v.columnCount-1);
            while(v.columnCount < ccnt)
                v.AddColumn();
            ProbTurnVectorTextBox.Text = v.ConvertToString();
            UpdateProbTurnVectorModeling();


            RefreshButton.Enabled = false;
            OkButton.Enabled = true;
        }