vectors are not same for ploting

조회 수: 1 (최근 30일)
Muhammad
Muhammad 2021년 5월 29일
댓글: Image Analyst 2021년 5월 30일
ind=strcmpi(names,'United States');
cases=covid_cases(ind,:)
deaths=covid_deaths(ind,:)
daily_cases=dailycases(ind,:)
fatalityr=deaths./cases;
fatality_per = fatalityr*100;
moving_avg=movmean(daily_cases,10)
scatter(moving_avg,fatality_per(:,end-1))
moving_avg 57*429 double
fatality_per 57*430 double
vector are not same what should be the modification in order to make scatter plot

채택된 답변

Cris LaPierre
Cris LaPierre 2021년 5월 29일
Make moving_avg a 57x429 array, or make fatality_per a 57x429 array.
It appears you have more columns of data in dailycases than you do in covid_cases and covid_deaths
  댓글 수: 5
Walter Roberson
Walter Roberson 2021년 5월 30일
편집: Walter Roberson 2021년 5월 30일
That is new as of R2021a; in R2020b it still did not accept arrays.
The user posted the error message in https://www.mathworks.com/matlabcentral/answers/843480-error-while-scatter-ploting?s_tid=srchtitle and it specifically says "vectors" in their release.
Image Analyst
Image Analyst 2021년 5월 30일
@Muhammad SULAMAN, what do the rows represent in your array? What do the columns represent? Does it make sense to lump them all together into one massive scatterplot? Or would it be more understandable to scatter just two corresponding rows or columns against each other?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by