HOW TO PLOT A LINE GRAPH AND TABLE FOR THE DATA BELOW

1 回表示 (過去 30 日間)
hassan USMAN
hassan USMAN 2016 年 6 月 22 日
コメント済み: dpb 2016 年 6 月 22 日
TABLE :5 Monthly Eb/No Level At Selected Radio Nigeria Fm Stations across Nigeria
MONTH COAL SUPREME METRO PREMIER
(A) (B) (C) (D)
JUL 2015 5.4 5 5.5 5
AUG 2015 6.4 6 6.8 6.4
SEP 2015 7.7 8 6.3 7.7
OCT 2015 4.6 5.6 6.3 4.6
NOV 2015 8.5 9.5 5.6 8.5
DEC 2015 5 12 5 5
JAN 2016 4 12 6.1 4
FEB 2016 6 11 6.3 6
MAR 2016 8.5 8 8.7 8.5
APR 2016 9.4 9 9.5 9.4
MAY 2016 4 7 8 6
DEC 2016 5 8 9 4
TO PLOT A LINE GRAPH OF MONTH ON X-AXIS AGAINST AND A,B,C, AND D ON Y-AXIS
  2 件のコメント
Muhammad Usman Saleem
Muhammad Usman Saleem 2016 年 6 月 22 日
please edit your question, or attached as text or excel file your table? difficult to read
dpb
dpb 2016 年 6 月 22 日
Have you read the examples at <create-a-table>? It shows building a histogram from table data; nothing much different than using plot instead.
Show us what you've tried and where you ran into problems...
doc plot

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

採用された回答

Valentino
Valentino 2016 年 6 月 22 日
編集済み: Valentino 2016 年 6 月 22 日
i guess you have the data in a txt file so you will have to use textscan and then plot
input = textscan(fileID,'%s%f%f%f%f','HeaderLines',1,'Delimiter', ' ');
  1 件のコメント
dpb
dpb 2016 年 6 月 22 日
Ah...perhaps you're right; I interpreted that the OP already had a table (Matlab style)...
Your textscan isn't likely going to work, however, if the file is as shown. Try
fmt=['%{MMM yyyy}D' repmat('%f',1,4)]; % one datetime, four floats
c=textscan(fid,fmt,'headerlines',5,'collectoutput',1);
'headerlines' is either 3 or 5, depending on whether the file includes the title lines or not...this will leave OP with a datetime cell array and then a cell array of doubles for the data.
If OP were to clean up the file to have just the column headers and the data, should be able to use readtable and get an internal table directly.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by