Hello,
any help?
I am just need to work on my data, however a bunch of them are missing. consider like i need to use all of them (no interp1 or fillmissing) , how can do it so far
consider like i need to scatter plot them.
thanks

댓글 수: 5

KSSV
KSSV 2020년 9월 13일
What you want to do with that?
Jean Habimana
Jean Habimana 2020년 9월 13일
i need a scatter plot from them
KSSV
KSSV 2020년 9월 13일
okay..you can striaght away use scatter. Data which is missing has NaN's, so scatter will not show them.
Jean Habimana
Jean Habimana 2020년 9월 13일
i have been trying to do so, but see the error
Error using scatter (line 56)
Input arguments must be numeric, datetime, duration or categorical.
Error in A2Q1draft (line 15)
Ameer Hamza
Ameer Hamza 2020년 9월 13일
Can you show the code?

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

 채택된 답변

Steven Lord
Steven Lord 2020년 9월 13일

0 개 추천

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'}) % curly brace indexing returns data
What won't work is passing tables into scatter.
figure
scatter(patients(:, 'Height'), patients(:, 'Weight')) % parentheses indexing returns a table
As originally created, the patients table has no missing data. We can change that.
patients2 = patients;
patients2{patients2.Height == 64, 'Weight'} = NaN;
% Show that it contains missing data
head(patients2)
% Plot it
figure
scatter(patients2.Height, patients2.Weight)

추가 답변 (1개)

Jean Habimana
Jean Habimana 2020년 9월 13일

0 개 추천

awesome.
that was very helpful

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

태그

질문:

2020년 9월 13일

댓글:

2021년 9월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by