Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

comparing matrix values

Status
Not open for further replies.

jess17

Junior Member level 3
Joined
Mar 4, 2011
Messages
26
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,431
I have a matrix X = [a, b ,c ; d ,e ,f; h, i ,j] and the values
a,b,c,d,e,f,g,h,i,j are not pre known. but i need to find out if they hold the same value, ie if a=b=c=d=e=f=h=g etc.
 

could you use a simple loop? e.g.
Code:
     bool same=true;
     for(i=0;i<3;i++)
        for(j=0;j<3;j++)
          if(X[0][0] != X[i][j])
              same= false;
could be made more efficent as a function, return when the comparison fails
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top