필터 지우기
필터 지우기

How do I create a boxplot from the excel file?

조회 수: 9 (최근 30일)
Keegan Carvalho
Keegan Carvalho 2018년 5월 21일
댓글: Ameer Hamza 2018년 5월 21일
I am studying yearly variations in sea level from 1993 to 2017. I import the excel file and assign x and y titles to the columns; x for the year and y for the sea level (in meters). I get an error as follows:
Error using boxplot>straightenX (line 896) 'X' parameter must be a numeric vector or matrix. Error in boxplot (line 274) [xDat,gDat,origRow,xlen,gexplicit,origInd,origNumXCols] = straightenX(x,g);
I would be grateful if someone could help me with this, preferably if you could send me the code. I've tried a couple of different ways but not successful. Thanks
(I have attached excel file titled 'sl.csv')

채택된 답변

Ameer Hamza
Ameer Hamza 2018년 5월 21일
Use it like this
data = readtable('sl.csv');
boxplot(data.Var2, data.Var1)
  댓글 수: 2
Keegan Carvalho
Keegan Carvalho 2018년 5월 21일
Thanks a lot @Ameer Hamza
Ameer Hamza
Ameer Hamza 2018년 5월 21일
You are welcome.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by