Hello,
If I have two vectors in excel file:
col A 0.34 0.65 0.21 0.54 0.34 0.89 . .
col B (22/01/2012 08:10:30) (22/01/2012 08:11:30) (22/01/2012 08:12:30) (22/01/2012 08:13:30) . .
My question is how can I plot both vectors?
Thanks.
Best,

2 件のコメント

Wayne King
Wayne King 2012 年 1 月 21 日
Do you have the Financial Toolbox by any chance?
Judah S
Judah S 2012 年 1 月 21 日
Hi Wayne,
Yes I have but never used it.
Please suggest further.
Thanks.
Regards

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

 採用された回答

Walter Roberson
Walter Roberson 2012 年 1 月 21 日

0 投票

You can use datenum to convert the date/times to linear times. You can plot(B,A) and you can use datetick to cause the x axis to be shown as time.

4 件のコメント

Judah S
Judah S 2012 年 1 月 21 日
Thanks Walter.
I have tried using datanum and successfully plotted A vs linear time.
But I was getting linear time on X axis as expected.
Can you please give an example of showing real time on X axis using datetick function?
Thanks.
Regards,
Walter Roberson
Walter Roberson 2012 年 1 月 21 日
datetick('x', 'HH:MM:SS')
Judah S
Judah S 2012 年 1 月 22 日
Thanks.
Here is my code
[ndata, text, alldata] = xlsread('D:\matlab\a.xlsx')
x = datenum(text, 'dd/mm/yyyy HH:MM:SS');
plot(x,ndata)
datetick('x', 'dd/mm/yyyy HH:MM:SS');
Only date is working but not time. Why is that?
if I check z=datestr(x), I get all correct values.
Thanks.
Judah S
Judah S 2012 年 1 月 22 日
Done
datetick('x', 'dd/mm/yyyy HH:MM:SS','keepticks');

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by