Calling scatter on data stored in a table array is possible. You just need to extract the data from the table rather than trying to scatter sub-tables. Let's take a sample table and create a scatter plot from the height and weight of patients at a hospital.
load patients
patients = table(LastName,Gender,Age,Height,Weight,Smoker,Systolic,Diastolic);
scatter(patients.Height, patients.Weight)
Note that I used the dot notation to extract the contents of those table variables. I could also have used the following, which opens a new figure so you can compare the two approaches.
figure
scatter(patients{:, 'Height'}, patients{:, 'Weight'})
What won't work is passing tables into scatter.
figure
scatter(patients(:, 'Height'), patients(:, 'Weight'))
As originally created, the patients table has no missing data. We can change that.
patients2 = patients;
patients2{patients2.Height == 64, 'Weight'} = NaN;
head(patients2)
figure
scatter(patients2.Height, patients2.Weight)
Best Answer