Use anonymous function to convert value before scatter plot
古いコメントを表示
Hi there,
Is it possible to call a function before doing a scatterplot? I have a table with values that represent an uint16. The value represent two different IDs. Using two anonymus function I'm able to get the IDs. I would like to plot first ID (PRN) on the y-axis and for each second ID (satType) a different color, the x-axis represent the time.
Is there a simple way to implent this?
Example value: 1838
Example plot:
My approach is as follows:
for i = 36:(width(rfs_csv_table))
if((i) <= width(rfs_csv_table))
all_plots(2) = subplot(2,1,2);
tmp = rfs_csv_table{:,i};
fktPRN = @(sigID) bitand(uint16(sigID),uint16(255));
fktSatType = @(sigID) bitshift(bitand(uint16(sigID), uint16(7936)),-8);
tmp = arrayfun(fkt,tmp);
scatter(rfs_csv_table{:,1},tmp);
hold on;
end
end
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Discrete Data Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
