Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK 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
Jul 13, 2001
5
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
 
Replies continue below

Recommended for you

Status
Not open for further replies.

Part and Inventory Search

Sponsor