25 pts.
 Diagonal matrices in VB6
Thanks for the first part. The second part---- well, imagine a 3 by 3 matrix. Row 1, Column 1 = some value, Row 2 Column 2 = some value and Row 3, Column 3 = some value. Everything else in the matrix = 0. How do you do that in VB 6 ?

Software/Hardware used:
ASKED: January 20, 2009  8:13 PM
UPDATED: January 21, 2009  2:30 PM

Answer Wiki:
<b><i>For others to understand</i></b>: this question is related to <a href="http://itknowledgeexchange.techtarget.com/itanswers/diagonal-matrices-in-vb6/">this one</a> You could use two for loops. Let's assume you have your parameters in an array (since you don't know how many variables you are going to need), for example: <pre>param(1) = temp param(2) = pressure param(3) = thrust</pre> Then, you could populate your matrix this way: <pre>For i = 1 To numofm For j = 1 To numofm If i = j Then diagmatrix(i, j) = param(i) Else diagmatrix(i, j) = 0 End If Next j Next i</pre>
Last Wiki Answer Submitted:  January 20, 2009  9:55 pm  by  carlosdl   63,535 pts.
All Answer Wiki Contributors:  carlosdl   63,535 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _