selecitng lines of same intercept from two matrices
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi
I have two matrices. Each of these matrices have straigh lines. For example in matrix A, i have 6 stragith lines. All of these lines havean y intercetp, and all have same slope. In matric B, i have another set og 6 lines. They also have same slope, and intercept times.
I like to compare lines between matrix A and matrix B, and only select that line which has same y intercept.
so for example, in matrix A, y intercept of 6 lines i s, 1,2,3,4,5,6 and in matrix B, y intercept is 1.5,2,2.5,4,5.5,6. so i like to select lines fromeither matrix A or B which have common intercept, that i s, line 2,4,and 6.
I have added images of two matrices. In both of these matrices, line1, 3 and 5th have same intercept.
I need to get these lines and save in a new matrix. These lines do not have the sampel element values
thanks
sal
4 commentaires
Rik
le 9 Nov 2020
Again, I don't understand your description, but if you have this:
A_data=[1,2,3,4,5,6];
B_data=[1.5,2,2.5,4,5.5,6];
Then you can use ismember to extract [2,4,6].
Réponses (0)
Voir également
Catégories
En savoir plus sur Medical Physics dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!