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!
