how to plot first five numbers of data

조회 수: 5 (최근 30일)
Muhammad
Muhammad 2021년 5월 29일
댓글: Jan 2021년 5월 30일
my workspace
named=names(:,1)
covvid=covid_cases(:,end)
[a,ind]=sort(covvid,'descend');
allindexes=length(a):1
bar(a)
set(gca, 'xticklabels', named(ind,:));
i want to plot only first 5 data values how i canmodify this so that it plot only first 5 data

채택된 답변

Jan
Jan 2021년 5월 29일
  댓글 수: 2
Muhammad
Muhammad 2021년 5월 29일
in x axes how i can plot fist five number of data ,remember that at x axes the data is string ,
Jan
Jan 2021년 5월 30일
Maybe you mean this:
[a, ind] = sort(covid_cases(:, end), 'descend');
bar(a(1:5))
set(gca, 'xticklabels', named(ind(1:5), 1));

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by