Filter löschen
Filter löschen

Boxplot with equal spaced interval?

1 Ansicht (letzte 30 Tage)
Ahmed
Ahmed am 29 Jan. 2024
Bearbeitet: Austin M. Weber am 31 Jan. 2024
Hi
I have a continuesous data with dimensions say yplot = 30 * 200 and I want to plot boxplot with the interval of 10 so that I have 20 plots instead of 200 for better visualization. How to to do it?
On x axis it is n = 1 * 200 - dimensions
figure, boxplot(yplot)

Akzeptierte Antwort

Austin M. Weber
Austin M. Weber am 29 Jan. 2024
Are you asking for something like this?
% Fake data
xdata = 1:200;
ydata = randn(30,200);
% Extract every tenth column
idx = 1 : 10 : length(xdata);
xdata_every_10th = xdata(idx);
ydata_every_10th = ydata(:,idx);
% Plot
figure
boxplot(ydata_every_10th)
xticklabels(xdata_every_10th)
  4 Kommentare
Ahmed
Ahmed am 31 Jan. 2024
Thank you very much. I do not know why boxchart is not working in my MATLAB (2018 version).
Austin M. Weber
Austin M. Weber am 31 Jan. 2024
Bearbeitet: Austin M. Weber am 31 Jan. 2024
@Nisar Ahmed, my apologies. The boxchart function was introduced in version R2020.
But, if you want, you have access to most recent version of MATLAB when you use MATLAB Online . No need to download a new Desktop version.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Object Identification finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by