how to scale values while plotting graphs in matlab

in my program i have to read a variable from an excel sheet of size 3600sec*24hrs.(column wise)
GDOP1=[]
GDOP=xlsread('positions.xlsx','GDOP'); => size=3600*24
for j=1:1
GDOP1=[GDOP1 GDOP(j:end)] =>size=1*86400(i.e one day data in sec)
end
now my problem is to plot this data(GDOP1) on y-axis against time on x axis in the form of 0 to 24hrs rather than from 0 to 86400 seconds

6 件のコメント

Star Strider
Star Strider 2015 年 3 月 22 日
It appears that you have data collected every second for 24 hours.
What do you mean by ‘scale this data(GDOP1) from 0 to 24hrs’. How do you want to ‘scale’ it?
Divya
Divya 2015 年 3 月 22 日
while plotting i want x axis in hrs rather than seconds
Image Analyst
Image Analyst 2015 年 3 月 22 日
How are you plotting it? Which variable, or column, is x and which is y?
Divya
Divya 2015 年 3 月 22 日
GDOP1(of size 1*86400) should be plotted on y axis and time on x axis the thing is time is in seconds but i would like it to scale down to hours
Image Analyst
Image Analyst 2015 年 3 月 22 日
That didn't answer a single one of my questions. I was expecting something like "the y values are in column 2 of GDOP1, and the x values are in column 1 but are in units of seconds instead of hours like I want. I'm plotting them like this
x = GDOP1(:, 1);
y = GDOP1(:, 2);
plot(x, y, 'b-');
Now, can you try again? Or, for bonus points, attach your workbook?
Divya
Divya 2015 年 3 月 22 日
in workbook i have only gdop values read for 24hrs such that each column represents 1 hour data and each block in that column is the gdop value for a sec

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

 採用された回答

Star Strider
Star Strider 2015 年 3 月 22 日

0 投票

This seems close to what you want to do:
sec = [1:86400]'; % Time In Seconds
GDOP1 = 0.1*randn(86400, 1) - cos(2*pi*sec/86400); % Create Data
hrs = sec/(60*60); % Convert Seconds To Hours
figure(1)
plot(hrs, GDOP1)
grid

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeModeling についてさらに検索

タグ

質問済み:

2015 年 3 月 22 日

コメント済み:

2015 年 3 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by