How to hold different constellations using scatterhistogram?
5 次查看(过去 30 天)
显示 更早的评论
Dear all,
I hope the title is explicit enough, does anyone have an idea?
Thanks in advance.
Best regards,
louis
Example of code:
% signal vector
X = rand(1,1e3)+1i*rand(1,1e3);
% power in signal
PX= mean(abs(X).^2);
% noise of variance power in signal/10
B = PX/10*(randn(1,1e3)+1i*randn(1,1e3));
% signal + noise
Y = X+B;
% plot
hold all
scatterhistogram(real(X),imag(X))
scatterhistogram(real(Y),imag(Y))
0 个评论
采纳的回答
Adam Danz
2022-7-29
编辑:Adam Danz
2022-7-29
scatterhistogram produces a ScatterHistogramChart object within a figure. When you call hold on, an axes is created if it doesn't already exist, and the axes is prepared to accept new objects. scatterhistogram tells you that you cannot assign the ScatterHistogramChart object to the axes.
Remove hold on so scatterhistogram can create the plot in a figure. Scatterhistogram() is not set up to combine two ScatterHistogramChart objects within the same set of axes.
2 个评论
Adam Danz
2022-8-1
编辑:Adam Danz
2022-8-1
@Louis Tomczyk, you can, however, group your data together in a table and use a grouping variable to plot multiple sets of data into the same scatterhistogram chart. There are some examples in the documentation: scatterhistogram.
load patients
tbl = table(LastName,Diastolic,Systolic,Smoker)
s = scatterhistogram(tbl,'Diastolic','Systolic','GroupVariable','Smoker');
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!