Renumbering nodes in a pointcloud or matrix
1 view (last 30 days)
Show older comments
Dear community,
I am trying to find a practical way to renumber the node IDs I get from my FEM software. As seen in the picture below, the node numbers are not in a perfect order.
My intention is to have a system with an increase of node numbers by coordinates.

That is,
N420 --> 1
N405 --> 2
N404 --> 3
N403 --> 4
N402 --> 5
N401 --> 6
N418 --> 7
N417 --> 8
...
Does anyone have a practical idea to sort/organize it?
Thank you very much.
The matrix here in this example is:
359 26.2702674865723 98.0414123535156 175
360 26.2703609466553 98.0413894653320 150.000015258789
361 26.2699527740479 98.0414962768555 124.999992370605
362 26.2697505950928 98.0415420532227 99.9999771118164
363 26.2697982788086 98.0415344238281 74.9999847412109
364 26.2699356079102 98.0414962768555 49.9999885559082
365 26.2700691223145 98.0414657592773 24.9999961853027
366 50.7500419616699 87.9015274047852 175
367 50.7501564025879 87.9014587402344 150.000015258789
368 50.7502784729004 87.9013824462891 125.000015258789
369 50.7503242492676 87.9013595581055 100.000022888184
370 50.7501449584961 87.9014663696289 75.0000076293945
371 50.7497825622559 87.9016876220703 49.9999885559082
372 50.7498664855957 87.9016342163086 24.9999923706055
373 71.7713394165039 71.7713394165039 175
374 71.7713394165039 71.7713394165039 150
375 71.7713394165039 71.7713394165039 125
376 71.7713394165039 71.7713394165039 100
377 71.7713394165039 71.7713394165039 75
378 71.7713394165039 71.7713394165039 50
379 71.7713394165039 71.7713394165039 25
380 87.9016342163086 50.7498664855957 175
381 87.9016876220703 50.7497825622559 150.000015258789
382 87.9014663696289 50.7501449584961 124.999992370605
383 87.9013595581055 50.7503242492676 99.9999771118164
384 87.9013824462891 50.7502784729004 74.9999847412109
385 87.9014587402344 50.7501564025879 49.9999885559082
386 87.9015274047852 50.7500419616699 24.9999980926514
387 98.0414657592773 26.2700691223145 175
388 98.0414962768555 26.2699356079102 150.000015258789
389 98.0415344238281 26.2697982788086 125.000015258789
390 98.0415420532227 26.2697505950928 100.000022888184
391 98.0414962768555 26.2699527740479 75.0000076293945
392 98.0413894653320 26.2703609466553 49.9999885559082
393 98.0414123535156 26.2702674865723 24.9999923706055
394 -6.21508222762180e-15 101.500000000000 25
395 -6.21508222762180e-15 101.500000000000 50
396 -6.21508222762180e-15 101.500000000000 75
397 -6.21508222762180e-15 101.500000000000 100
398 -6.21508222762180e-15 101.500000000000 125
399 -6.21508222762180e-15 101.500000000000 150
400 -6.21508222762180e-15 101.500000000000 175
401 26.2701263427734 98.0414505004883 0
402 50.7499885559082 87.9015579223633 0
403 71.7713394165039 71.7713394165039 0
404 87.9015579223633 50.7499885559082 0
405 98.0414505004883 26.2701263427734 0
406 26.2701263427734 98.0414505004883 200
407 50.7499885559082 87.9015579223633 200
408 71.7713394165039 71.7713394165039 200
409 87.9015579223633 50.7499885559082 200
410 98.0414505004883 26.2701263427734 200
411 101.500000000000 1.24301644552436e-14 175
412 101.500000000000 1.24301644552436e-14 150
413 101.500000000000 1.24301644552436e-14 125
414 101.500000000000 1.24301644552436e-14 100
415 101.500000000000 1.24301644552436e-14 75
416 101.500000000000 1.24301644552436e-14 50
417 101.500000000000 1.24301644552436e-14 25
418 -6.21508222762180e-15 101.500000000000 0
419 -6.21508222762180e-15 101.500000000000 200
420 101.500000000000 1.24301644552436e-14 0
421 101.500000000000 1.24301644552436e-14 200
2 Comments
Rik
on 21 Mar 2019
Based on your previous question, I suspect you have tried something already. Did you manage to find the connected pairs?
Answers (0)
See Also
Categories
Find more on Sparse Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!