Create a new table from a plot constructed from data points
Afficher commentaires plus anciens
Dear all,
Reading an excel sheet with around 24000 data points, I made a plot. Now I would like to create a new table from this plot with a user-defined interval, let say with only 10 data points. Is it possible to do so in Matlab?
Many thanks in advance.
Bhattarai
Réponses (2)
% a table with 1000 rows:
t = table((1:1000).',2*(1:1000).'+100,'VariableNames',{'x' 'y'})
% user-defined interval over x:
x_limits = [200 209];
% logical index saying whether each x in the table is within the interval:
idx = t.x >= x_limits(1) & t.x <= x_limits(2);
% new table with x and y but only where x is within the interval:
new_t = table(t.x(idx),t.y(idx),'VariableNames',{'x' 'y'})
1 commentaire
aroj bhattarai
le 18 Jan 2022
aroj bhattarai
le 16 Fév 2022
Modifié(e) : aroj bhattarai
le 16 Fév 2022
0 votes
Catégories
En savoir plus sur Tables dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!