Diagonal matrices in VB6

25 pts.
Tags:
Diagonal matrices
VB 6
Visual Basic
Visual Basic 6
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 ?
ASKED: January 20, 2009  8:13 PM
UPDATED: September 10, 2013  7:23 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

For others to understand: This question is related to this similar one.
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:

param(1) = temp
param(2) = pressure
param(3) = thrust

Then, you could populate your matrix this way:

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

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following