Matlab - Eliminar datos de dos matrices

   
Vista:

Eliminar datos de dos matrices

Publicado por BUDDY (5 intervenciones) el 19/10/2015 02:52:35
Tengo la siguiente consulta:

Tengo 3 matrices con los siguientes datos:

control =

1 5850295.604582 735251.205917
2 5850299.08892 735246.431921
3 5850280.42282 735183.442318
4 5850283.997661 735177.763299
5 5850221.177751 734965.229955
6 5850153.535764 734967.447261
7 5850146.821625 734968.963175
8 5850066.396188 734972.204289
9 5850058.567739 734980.666254
10 5850058.092602 734989.580731
11 5850034.584629 735006.685666
12 5849988.284217 735004.850166
13 5849857.903631 735034.739965
14 5849848.762898 735049.933039
15 5849850.7992 735050.838062
16 5849923.31417 735211.027137
17 5849926.119741 735224.71561
18 5849953.940715 735342.767379
19 5850126.711024 735316.992606
20 5850127.208786 735319.775552
21 5850061.028978 735230.285744
22 5850006.320336 735167.827843
23 5850090.736358 735150.8926
24 5850101.098872 735128.538531
25 5850154.326953 735135.150855
26 5850214.182913 735121.589651
27 5850305.595894 735278.577207
28 5850309.261238 735281.111272
29 5850237.130903 735293.068888
30 5850237.764419 735295.964962
31 5850208.984687 735122.681335
32 5850221.971767 735120.034143
33 5850232.990422 735185.150549
34 5850226.338503 735186.73434
35 5850223.623434 735187.232102
36 5850237.787044 735207.911878
37 5850231.72339 735209.224162
38 5850228.420056 735210.038682
39 5850198.780552 735216.334249
40 5850158.869037 735225.203474

patron =

1 5850295.797 735251.126
2 5850299.095 735246.408
3 5850280.547 735182.952
4 5850283.856 735177.968
5 5850221.313 734965.148
6 5850152.278 734967.811
7 5850146.731 734969.27
8 5850066.337 734972.235
9 5850058.586 734980.582
10 5850058.466 734990.573
11 5850034.538 735006.549
12 5849988.417 735005.083
13 5849857.749 735034.831
14 5849848.627 735049.748
15 5849850.667 735050.832
16 5849922.994 735210.812
17 5849926.11 735224.581
18 5849953.703 735342.705
19 5850126.499 735317.234
20 5850127.095 735319.907
21 5850061.139 735229.954
22 5850006.395 735167.592
23 5850091.296 735151.256
24 5850101.102 735128.678
25 5850154.253 735135.087
26 5850214.201 735121.501
27 5850305.34 735279.027
28 5850309.627 735280.607
29 5850237.104 735292.951
30 5850237.781 735295.606
31 5850209.153 735122.924
32 5850221.964 735119.969
33 5850233.064 735185.065
34 5850226.117 735186.506
35 5850223.659 735187.317
36 5850237.558 735207.646
37 5850231.68 735208.973
38 5850228.265 735209.569
39 5850199.053 735216.415
40 5850158.817 735225.22

LISTO =

1 0.83101224411386 -0.227620743312357
2 0.142345280639282 -0.0316747459643622
4 -0.40367509876884 0.768338930683086
5 0.619727364680192 -0.23475228752652
7 -0.215056528505665 1.1256999751173
8 -0.0988718350910828 0.159498225711239
9 0.187363756635164 -0.242797145316341
11 -0.0524563536164556 -0.426201703241511
12 0.61061353654706 0.866784333050102
13 -0.451609552172652 0.37058913166021
14 -0.382376231937743 -0.59547264647739
15 -0.368709184700216 0.0308189959532395
16 -1.06340768257757 -0.700794144892763
17 0.0838741168414729 -0.419007171813963
18 -0.758670945428783 -0.166250272484154
19 -0.663722288999486 0.896738217904173
20 -0.300654824151224 0.512005761105718
21 0.52649355619988 -1.10883534306952
22 0.395817651395788 -0.773250353055629
24 0.13143529473753 0.540073530907353
25 -0.153440244573663 -0.171415217871174
26 0.186720688654294 -0.258183504019324
27 -0.825856791953803 1.62598584158388
29 0.0204468918501891 -0.36049211779534
30 0.181154822744436 -1.20407889915702
31 0.741925115965702 0.901185809980219
32 0.0911696139909798 -0.175922297848342
33 0.3918040206796 -0.247328720479358
34 -0.698754726155103 -0.746995212748883
35 0.251319479965174 0.349114015650386
36 -0.726624708893226 -0.878351396835211
37 -0.0404856743540913 -0.826855909445666
38 -0.453180267340145 -1.59151980287207
39 1.12678667927732 0.334602478495525
40 -0.0724432111456705 0.109860859283387


si se fijan tanto la matriz control como patron tienen la primera columna numerada de 1 al 40, y la matriz LISTO tiene en su primera columna numerada de 1 al 40 pero hay algunas filas que no las tiene por ejemplo la fila 3, 6,10,23,28 .

Quisiera hacer que tanto patron como control se modifiquen y queden con los datos que indica la primera fila de la matriz LISTO, mas o menos asi:

control=
1 5850295.604582 735251.205917
2 5850299.08892 735246.431921
4 5850283.997661 735177.763299
5 5850221.177751 734965.229955
7 5850146.821625 734968.963175
8 5850066.396188 734972.204289
9 5850058.567739 734980.666254
11 5850034.584629 735006.685666
12 5849988.284217 735004.850166
13 5849857.903631 735034.739965
14 5849848.762898 735049.933039
15 5849850.7992 735050.838062
16 5849923.31417 735211.027137
17 5849926.119741 735224.71561
18 5849953.940715 735342.767379
19 5850126.711024 735316.992606
20 5850127.208786 735319.775552
21 5850061.028978 735230.285744
22 5850006.320336 735167.827843
24 5850101.098872 735128.538531
25 5850154.326953 735135.150855
26 5850214.182913 735121.589651
27 5850305.595894 735278.577207
29 5850237.130903 735293.068888
30 5850237.764419 735295.964962
31 5850208.984687 735122.681335
32 5850221.971767 735120.034143
33 5850232.990422 735185.150549
34 5850226.338503 735186.73434
35 5850223.623434 735187.232102
36 5850237.787044 735207.911878
37 5850231.72339 735209.224162
38 5850228.420056 735210.038682
39 5850198.780552 735216.334249
40 5850158.869037 735225.203474

espero haberme expresado claramente.
De antemano muchas gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
información
Otras secciones de LWP con contenido de Matlab
- Código fuente de Matlab
- Cursos de Matlab
- Temas de Matlab
- Chat de Matlab
información
Códigos de Matlab
- Fuerzas de Coulomb
- TRIÁNGULO
- Fixed Pivot
Imágen de perfil de Royeth

Eliminar datos de dos matrices

Publicado por Royeth jesus.royeth@gmail.com (749 intervenciones) el 19/10/2015 03:34:01
para eso usa

1
2
patron(setdiff(patron(:,1),LISTO(:,1)),:)=[];
control(setdiff(control(:,1),LISTO(:,1)),:)=[];

ejecución :

patron

patron =

1 5850295.797 735251.126
2 5850299.095 735246.408
4 5850283.856 735177.968
5 5850221.313 734965.148
7 5850146.731 734969.27
8 5850066.337 734972.235
9 5850058.586 734980.582
11 5850034.538 735006.549
12 5849988.417 735005.083
13 5849857.749 735034.831
14 5849848.627 735049.748
15 5849850.667 735050.832
16 5849922.994 735210.812
17 5849926.11 735224.581
18 5849953.703 735342.705
19 5850126.499 735317.234
20 5850127.095 735319.907
21 5850061.139 735229.954
22 5850006.395 735167.592
24 5850101.102 735128.678
25 5850154.253 735135.087
26 5850214.201 735121.501
27 5850305.34 735279.027
29 5850237.104 735292.951
30 5850237.781 735295.606
31 5850209.153 735122.924
32 5850221.964 735119.969
33 5850233.064 735185.065
34 5850226.117 735186.506
35 5850223.659 735187.317
36 5850237.558 735207.646
37 5850231.68 735208.973
38 5850228.265 735209.569
39 5850199.053 735216.415
40 5850158.817 735225.22

control

control =

1 5850295.604582 735251.205917
2 5850299.08892 735246.431921
4 5850283.997661 735177.763299
5 5850221.177751 734965.229955
7 5850146.821625 734968.963175
8 5850066.396188 734972.204289
9 5850058.567739 734980.666254
11 5850034.584629 735006.685666
12 5849988.284217 735004.850166
13 5849857.903631 735034.739965
14 5849848.762898 735049.933039
15 5849850.7992 735050.838062
16 5849923.31417 735211.027137
17 5849926.119741 735224.71561
18 5849953.940715 735342.767379
19 5850126.711024 735316.992606
20 5850127.208786 735319.775552
21 5850061.028978 735230.285744
22 5850006.320336 735167.827843
24 5850101.098872 735128.538531
25 5850154.326953 735135.150855
26 5850214.182913 735121.589651
27 5850305.595894 735278.577207
29 5850237.130903 735293.068888
30 5850237.764419 735295.964962
31 5850208.984687 735122.681335
32 5850221.971767 735120.034143
33 5850232.990422 735185.150549
34 5850226.338503 735186.73434
35 5850223.623434 735187.232102
36 5850237.787044 735207.911878
37 5850231.72339 735209.224162
38 5850228.420056 735210.038682
39 5850198.780552 735216.334249
40 5850158.869037 735225.203474



saludos
https://www.facebook.com/royethmatlab/
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Eliminar datos de dos matrices

Publicado por BUDDY (5 intervenciones) el 20/10/2015 19:58:28
muchas gracias por la ayuda, me sirvió de mucho, por fin pude terminar mi programa, de verdad muchas gracias
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar