Group Transpose and plot

4 views (last 30 days)
Maneesh
Maneesh on 14 Oct 2019
Answered: Maneesh on 18 Oct 2019
Hi,
I want to group and transpose a set of data and then crpresent is as a plot.
Please see the attached excel file Graph.xlsx.
As given in sheet1 of the file,
Range A2:C108 contain the raw data. I want to group and transpose it to as given in the range F1:P14
And finally plot the transformed data.
Please help.
Thanks

Answers (1)

Maneesh
Maneesh on 18 Oct 2019
Got it
filename = 'Graph.xlsx';
sheet1 = 'Sheet1'; %All ISINs in the portfolio
xlRange1 = 'A2:C108';
scoreData = readtable(filename,'Sheet','Sheet1','Range','A2:C108','ReadVariableNames',true);
scoreData2cell = table2cell(scoreData);
M=cell2mat(scoreData2cell(:,2:3));
[~,Header]=ismember(scoreData2cell(:,1),unique(scoreData2cell(:,1)));
K=accumarray([M(:,1),Header],M(:,2));

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!