I am having trouble defining a diagonal matrix.
I am using code that is something like
public diagmatrix(numofm, numofm) as long
(numofm has been pre-set as some number)
but i'm getting an error message, "constant expression required". Thing is, to begin with, the number of columns and rows (square matrix) should be equal to "numofm"; this is because "numofm" will change on different occassions as selected by users and the code " public diagmatrix(numofm, numofm) as long" was meant to allow the matrix dimensions to change accordingly.
Secondly, the diagonal elements are dependent on other variables, say, 3 variables, temperature, pressure and thrust. This would thus require a 3by3 diagonal matrix. How would I define these diagonal elements ? Say, Row1, column 1 should be reciprocal of temp.
Row2, column 2 should be reciprocal of pressure
Row3, column 3 should be reciprocal of thrust
Every other element would ofcoure be zero, being a diagonal matrix.
Temp, pressure and thrust are variables and users can add to these, thus requiring a larger matrix---or reduce these variables, thus requiring a smaller matrix.
January 15, 2009 10:18 PM
January 24, 2009 8:38 PM