transform data from rows to columns

조회 수: 2 (최근 30일)
Myurathan Kajendran
Myurathan Kajendran 2016년 6월 21일
댓글: Myurathan Kajendran 2016년 6월 21일
I have a CSV data file. That looks like below company-----Date--------Price ComA--------15/05/2015--20.5 ComA--------15/06/2015--30 Comb--------15/05/2015--15
I want the companies to be in the columns and dates to be rows. How to do that?

채택된 답변

Shameer Parmar
Shameer Parmar 2016년 6월 21일
If you have variable 'data' like..
data = {'company-----Date--------Price', 'ComA--------15/05/2015--20.5', 'ComA--------15/06/2015--30', 'Comb--------15/05/2015--15'}
then
following command give you the expected result in column..
data = data';
output will be as follows:
data =
'company-----Date--------Price'
'ComA--------15/05/2015--20.5'
'ComA--------15/06/2015--30'
'Comb--------15/05/2015--15'
  댓글 수: 1
Myurathan Kajendran
Myurathan Kajendran 2016년 6월 21일
Thank you so much for your quick reply. I will try and get back. Thanks again

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

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by