Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
how do i "re attach" string columns to data columns for identification?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
when i input data, matlab always separates my string data( column headers and row id's) from the data it represents...i have been able to work around this because matlab keeps everything in place and it is easy to slap them back together outside of matlab... but i am working with data brushing and graphs, the databrushing retrieves the data values but not the row id...so how do i "link' my data with its original identifiers in Matlab???
1 Kommentar
Antworten (1)
Sean de Wolski
am 19 Dez. 2013
If I understand you correctly, here is a small example:
x = rand(100,1);
y = rand(100,1);
names = char(randi(100,[100 3])+50); %random names
scatter(x,y);
%Do the brushing
%
% Brush your selection and then right-click, create variable, name it
% xbrush
%
[~,idx] = ismember(xbrush,[x y],'rows'); %locate them
names(idx) %extract names
11 Kommentare
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!