필터 지우기
필터 지우기

i want to plot line grahp of the following data pls help

조회 수: 2 (최근 30일)
hassan USMAN
hassan USMAN 2016년 6월 21일
답변: Star Strider 2016년 6월 21일
x=[July'15 Aug'15 Sept'15 Oct'15 Nov'15 Dec'15 Jan'16 Feb'16 Mar'16 April'16 May'16] y=[5.7 7.2 7.8 6.8 7.5 7.8 8.0 7.6 8.8 6.3 6.0]; z=[6.5 7.7 8.5 8.8 9.0 12 12 11.9 10.8 7.1 8.3]; w=[6.5 7.7 8.7 8.2 8.3 10.2 11.5 11.7 9.5 6.5 7.0]; v=[6.2 7.3 8.2 8.2 8.5 9.3 10.9 11.7 10.0 6.6 6.4]; plot (x,y,'r-',x,z,'b-',x,w,'k-',x,v,'m-') xlabel 'TX POWER' ylabel 'Eb/No(dB) Levels' title 'Eb/No Level at Selected Radio Nigeria FM stations accross Nigeria' grid on legend('Suprime FM','Coal City FM','Metro FM','Premier FM')

채택된 답변

Star Strider
Star Strider 2016년 6월 21일
You first have to convert your dates to date numbers (using the datenum function). Then use that as your x-coordinate (independent variable) in your plot, and use the datetick function to format the date numbers as date strings.
This should get you started:
x = {'July 15'; 'Aug 15'; 'Sept 15'; 'Oct 15'; 'Nov 15'; 'Dec 15'; 'Jan 16'; 'Feb 16'; 'Mar 16'; 'April 16'; 'May 16'};
xdn = datenum(x); % Use This For ‘x’
xds = datestr(xdn, 'mmm yy') % Check Conversion (Not Necessary For Code)
I had to convert your dates to a cell array of strings. See: Cell Arrays for details. See the documentation for times and dates as well.
I leave the rest to you.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by