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!
