MATLAB Answers

How can I rename a colum? How can I show several matrices/vectors within one Boxplot?

조회 수: 1(최근 30일)
Max Behr
Max Behr 4 Aug 2019
답변: dpb 4 Aug 2019
Hello,
I got a matrix like this:
>> z= rand(4)
z =
0.3816 0.4898 0.7547 0.1626
0.7655 0.4456 0.2760 0.1190
0.7952 0.6463 0.6797 0.4984
0.1869 0.7094 0.6551 0.9597
And if I boxplot it, it only shows me 1,2,3,4 in the x-axis:
boxplot(z)
I would like to rename the columns? Is it possible?
-----
And I have another question:
How can I integrate several matrices/vectors within a boxplot?
I got seperated matrix for the base, the testing and the resting afterwards.
And I would like to have something like this:
base 1, base 2 , base 3, testing 1, testing 2, testing 3, resting 1, resting 2, resting 3 and the according Boxplot above it.
-------
Thanks!

  댓글 수: 0

댓글을 달려면 로그인하십시오.

답변(1개)

dpb
dpb 4 Aug 2019
  1. use optional named labels parameter--boxplot(z,'labels',{'A','B','C','D'})
  2. boxplot([base testing resting]) % each is assumed to be nx3 array

  댓글 수: 0

댓글을 달려면 로그인하십시오.

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by