How can I graph data from a database in my program
이전 댓글 표시
Hi, Confused on how I would get data from my database (in this case im trying to graph the property price, with price as the Y axis and the adress as the X axis). I am not quite sure how to retrive this data from the data base. it is option 9 in the program I have attached. Thanks
댓글 수: 1
Image Analyst
2022년 6월 11일
Exactly what kind of database do you have? Like Oracle, Microsoft Access, or whatever? Do you have the Database Toolbox?
답변 (1개)
property.propertyprice and property.Address are both strings. It's possible to remove the $ and , characters from the prices and then convert the prices to numbers, but it's not clear how the addresses should be used in the plot, so here I've just made a plot of each property's price and labeled the xticks with the addresses.
Project2v2_2
Take a look at the attached code in the option == 9 block and see if you can adapt it as necessary.
(FYI, to get the code to run here, I removed the input call and hard-coded option = 9 and also put a break statement at the end of the while loop so it would stop after making the plot.)
카테고리
도움말 센터 및 File Exchange에서 Database Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
