Hi Everyone, my first post here. This should be a easy but it's driving me crazy!. I have tried finding the answer in the documentation and on the forums but I cannot, apologies, I know this will be obvious once I know.
I have an Excel file with data formatted as such:
a b
1 2019-05-23 $100.30
2 2019-05-24 $100.40
3 2019-05-25 $100.50
4 2019-05-26 $100.60
I imported the file and it shows in workspace as DatePrice. I have tried two methods to plot this and failed:
1) >> plot (DatePrice(1:4,1),DatePrice(1:4,2))
Error using tabular/plot
Too many input arguments.
2)
>> date = DatePrice(1:4,1) --------- this returns the dates properly
>> price = DatePrice(1:4,2) ----------- this returns the prices properly
>> plot (date,price) -------------I get this error
Error using tabular/plot
Too many input arguments.
PS: I have searched the forums and I know I have to do something like datenum(xxxxxxxxx) but I'm not sure what. I tried to no avail:
>> dateToNumber = datenum(DatePrice(1:4,),'yyyy-mm-dd')
Can anyone kindly help?

댓글 수: 1

dpb
dpb 2019년 8월 6일
Show the code used to import the data and what does
whos DatePrice date price
show after you do the above?
OH--Also, maybe you've inadvertentedly aliased the plot() function. Show us also what
which -all plot
returns.
It can't hurt anything, so instead of waiting for us,
clear plot
and then try again and see if symptoms go away. If so, that's what happened; you accidentally overwrote the plot name.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Calendar에 대해 자세히 알아보기

질문:

2019년 8월 6일

댓글:

dpb
2019년 8월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by