Use anonymous function to convert value before scatter plot
Show older comments
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
Accepted Answer
More Answers (0)
Categories
Find more on Discrete Data Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!