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!
