Creating a boxplot from 2 tables

I am working with a dataset that containts 100 sample from red and 100 sample white wine. Basiclly I have 2 tables, one for red and one for white. Each table containts 12 charateristics that are mesearued for both wines. Now I need to make box plot for each of the charatersitic of wine for both red and white. That is 24 box plot. I tried to use function boxplot(Name of the table), but I get 12 boxplot that are not scaled and not usable.
I need a answer which is the easiset way to make one boxplot from table that I need and for characterstic I need.
Thank you in advance

Answers (1)

If you have two tables t1 and t2, you can combine them in boxplot by combining their matrices
boxplot([t1.Variables t2.Variables])

5 Comments

This is the message I got. I wanted to boxplot column one(which is for example acidity) from red wines, and column one from white (which is also acidity). Both "red" and "white" are tables 100x12, where each of 12 columns represent some characteristics, and both tables have same 12 characteristics.
I have also tried
boxplot(red.1,white.1)
But I get the same message
That code will only work if you want to select all the columns. If you only want to select first column then try
boxplot([t1{:,1} t2{:,1}])
Faris Durakovic
Faris Durakovic on 20 Mar 2020
Edited: Faris Durakovic on 20 Mar 2020
Now I got this xd
Ameer Hamza
Ameer Hamza on 21 Mar 2020
Edited: Ameer Hamza on 21 Mar 2020
Which release of MATLAB are you using? What is the type of variables red and white? Are these matrices or tables?
Matlab version I am using.
This is how the data is imported in matlab
This is how it looks in matlab. I am new to matlab, but these should suppose to be tables if I am not mistaken!?

Sign in to comment.

Asked:

on 20 Mar 2020

Commented:

on 21 Mar 2020

Community Treasure Hunt

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

Start Hunting!