Help defining a variable and bar chart?

9 ビュー (過去 30 日間)
Dustin
Dustin 2014 年 6 月 25 日
コメント済み: Star Strider 2014 年 6 月 25 日
There is a set of data with 5 columns and column 2 is bacteria1 column 3 is bacteria2. How would you make a variable holding the data from columns 2 and 3?
How would you make a bar chart corresponding to this?

回答 (2 件)

Star Strider
Star Strider 2014 年 6 月 25 日
Days = [1:30]'; % Days
Bact1 = randi(33,30,1); % Bacteria 1 Counts
Bact2 = randi(66,30,1); % Bacteria 2 Counts
Data = [Days Bact1 Bact2]; % Data set matrix
Bact = Data(:,2:3); % Variable for Bact1, Bact2
figure(1)
bar(Bact) % Plot the bar chart
  2 件のコメント
Dustin
Dustin 2014 年 6 月 25 日
What are all these "randi" numbers ?
Star Strider
Star Strider 2014 年 6 月 25 日
The randi function generates random integers. I used it to create data to plot.

サインインしてコメントする。


Dustin
Dustin 2014 年 6 月 25 日
What are all these "randi" numbers ?

カテゴリ

Help Center および File ExchangeNetworks についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by