HI,
I have copied and pasted data from excel, each population has different number of readings and as a result the smaller populations are filled with zeros in the remaining cells.
thefore when i do a boxplot of the workspace it includes the zeros, I was wondering if there is a way of removing the zero values and still doing the boxplot
Thanks

3 Kommentare

Ameer Hamza
Ameer Hamza am 9 Mär. 2020
Can you show us a sample of your dataset? How do you want to remove zeros, do you want to delete rows?
Alfie Skehel
Alfie Skehel am 9 Mär. 2020
Alfie Skehel
Alfie Skehel am 9 Mär. 2020
I just need them to not equal zero so be just empty cells if that is possible?
Thanks

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 9 Mär. 2020

0 Stimmen

If you are just making boxplot, setting them to nan will work.
A = ...; % suppose A is the name of your matrix
A(A==0) = nan;
boxplot(A);

2 Kommentare

Alfie Skehel
Alfie Skehel am 9 Mär. 2020
Thats perfect! thanks very much
Ameer Hamza
Ameer Hamza am 9 Mär. 2020
Glad to help.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by