how to plot first five numbers of data

4 次查看(过去 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
bar(a(1:5))
  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