Info

この質問は閉じられています。 編集または回答するには再度開いてください。

how do i "re attach" string columns to data columns for identification?

3 ビュー (過去 30 日間)
john borsellino
john borsellino 2013 年 12 月 19 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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 件のコメント
Sean de Wolski
Sean de Wolski 2013 年 12 月 19 日
Can you provide a small example?

回答 (1 件)

Sean de Wolski
Sean de Wolski 2013 年 12 月 19 日
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 件のコメント
john borsellino
john borsellino 2013 年 12 月 19 日
iam looking into how to work with cell array data...
Sean de Wolski
Sean de Wolski 2013 年 12 月 20 日
Just attach your file and the code you're using right now.

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by