How do I keep my current group IDs but then add in two other variables that the code needs to consider?
Show older comments
I have a code below that seperates the items in an excel sheet into groups based on their lithology. I have attached it below along with the excel sheet. However, I am now needing to not only group by lithology but also to be able to read off each lithology's void ratio and bulk density. These two extra variables are also in the excel sheet, just in a different column. Is there any way to do this? Any help would be appriciated.
t = readtable('CostaRica_1253.xlsx');
[G,group_ID] = findgroups(t{:,4});
n_groups = numel(group_ID);
new_t = cell(1,n_groups);
for ii = 1:n_groups
new_t{ii} = t(G == ii,:);
end
Chalk1_1253=new_t{1};
%%
Gabbro_1253=new_t{2};
%%
Chalk2_1253=new_t{3};
%%
Chalk_1253=[Chalk1_1253;Chalk2_1253];
%%
Siliciclastic_1253=[Chalk_1253;Gabbro_1253];
Siliciclastic_1253_data = [table2array(Siliciclastic_1253(:,2)) table2array(Siliciclastic_1253(:,5:8))];
%%
figure(4)
plot(Siliciclastic_1253_data(:,3),Siliciclastic_1253_data(:,1),'b.');
axis ij
xlabel ('Porosity(%)');
ylabel ('Depth(m)');
title('Costa Rica 1253 Porosity Vs Depth');
hold on
Accepted Answer
More Answers (0)
Categories
Find more on Data Distribution Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
