Plotting 3D scattered data using CSV

Hello,
I want to plot the participants' information ( Number of people, Ages , BMI ) of my experiment into a professional 3D plot using MATLAB.
The data showing as below: ( the data is saved in CSV file names "Participants" ):
Please anyone can help me how to do that?

 Accepted Answer

Tala
Tala on 29 Mar 2022
T= readmatrix('Participants.csv');
x=T(:,1);
y=T(:,2);
z=T(:,3);
scatter3(x,y,z)

10 Comments

I am confused what is the proper way to plot these information? any suggestion
just copy and paste the code. it will work just fine
I mean do you have any other idea that to present this data in better way.
if your data is share-able, please do so, I will take a look
I am recording data for my experiment and I want to present the participants information in my journal in better way. your suggestions is highly apprecaited.
The data attached.
I would show the corrolations between variables.
T1= readtable('Participants_1.xlsx');
T1.Gender = categorical(T1.Gender);
T1.Gender = double(T1.Gender);
T2=table2array(T1);
imagesc(corrcoef(T2)); colorbar
xticks([1 2 3 4 5])
xticklabels({'Age','Gender','Height','Weight','BMI'})
yticks([1 2 3 4 5])
yticklabels({'Age','Gender','Height','Weight','BMI'})
I think we dont need to plot the height and weight since BMI there.
I am not an expert in your field. If you feel you need to drop the values, you can easily do so.
T1= readtable('Participants_1.xlsx'); T1 = removevars(T1, {'Height_cm_','Weight_kg_'});
T1.Gender = categorical(T1.Gender);
T1.Gender = double(T1.Gender);
T2=table2array(T1);
%%
imagesc(corrcoef(T2)); colorbar
xticks([1 2 3])
xticklabels({'Age','Gender','BMI'})
yticks([1 2 3])
yticklabels({'Age','Gender','BMI'})
Tala
Tala on 30 Mar 2022
Edited: Tala on 30 Mar 2022
anytime :)

Sign in to comment.

More Answers (0)

Asked:

on 29 Mar 2022

Edited:

on 30 Mar 2022

Community Treasure Hunt

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

Start Hunting!