Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

When merging two tables, then restart the number of rows

2 Ansichten (letzte 30 Tage)
Hinna Ahmed
Hinna Ahmed am 27 Nov. 2019
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hey
I have merged two tables. Is it possible to restart the number of rows when the second table is placed under the first on. The row is not a part of the table. It's the tables rownumber in matlab
What I want to do in matlab. Example:
Capture.PNG

Antworten (1)

Guillaume
Guillaume am 27 Nov. 2019
No, as you've stated the row number is not part of the table, it's only there to help you in case you need to index the table rows and thus will always go from 1 to the number of rows in the table.
If you want a special identifier for each row, then you'll have to explicitly add that identifier (which you can call RowNumber if you wish) as a table variable.
mergedtable.RowNumber = [1:height(firsttable), 1:height(secondtable)].';

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by