Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

ok, another programming question

Status
Not open for further replies.

autiger

Structural
Joined
Jul 13, 2001
Messages
5
Location
US
ok, got another one

I have a matrix

R = 0
0
2
1

I need to populate vector, c, with that will only have values for non-zero entities.

If R(sub 1) = 0 then do nothing
else
if R(sub 1) = 1 Then the entry into c is 5
else
if R(sub 1) = 2 Then the entry into c is 10


So, result for above would be

c = 10
5

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top