I have a matrix which a call vacia1(180×9). The number of rows will always be 180, but the number of columns will vary depending on the user of the program. The columns will grow in sets of 3 by 3. What I need for the program to do is to create new matrices from the original matrix, called vacia1, which can grow in sets of 3 by 3. An example would be: v1=vacia1(:,1:3) v2=vacia1(:,4:6) v3=vacia1(:,7:9)
This example gives the answer that I need, however I need for the program to give the new matrices without the user having to enter the indexes of what columns to obtain from matrix vacia1. After that I need to id the positions of the repeating lines (rows) in the new matrices. To solve the second problem I have this: [uniquevacia1,~,uIdx]=unique(v1,'rows') modeIdx=mode(uIdx) modeRow=uniquevacia1(modeIdx,:) whereIdx=find(uIdx==modeIdx)
[uniquevacia2,~,uIdx2]=unique(v2,'rows') modeIdx2=mode(uIdx2) modeRow2=uniquevacia2(modeIdx2,:) whereIdx2=find(uIdx2==modeIdx2)
[uniquevacia3,~,uIdx]=unique(v3,'rows') modeIdx=mode(uIdx) modeRow=uniquevacia3(modeIdx,:) whereIdx3=find(uIdx==modeIdx)
This will give the rows that repeat in the original matrix (vacia1). But I do not know how to tell MathLab to do all of this for Vn matrices.
Thanks in advance!!!
Best Answer