I am trying to load my data from a JSON file into MATLAB that is delimited with ,.
The format of my data is as follows:
{"created_at": "Mon Oct 27 20:35:47 +0000 2014", "tweet": "Silver Finished Up, Gold, Copper, Crude Oil, Nat Gas Down - Live Trading News http://t.co/jNLTUIgHwA", "id": 526834668759285761, "sentiment": "negative"}
{"created_at": "Mon Oct 27 20:36:21 +0000 2014", "tweet": "Gold, Silver slips on lacklustre demand- The Economic Times http://t.co/Jd5Tn9ctfX", "id": 526834810300289024, "sentiment": "negative"}
How would I do so?
As of version 2016b, Matlab has integrated json support.
See: https://www.mathworks.com/help/matlab/ref/jsondecode.html
In short, you do:
jsonData = jsondecode(fileread('file.json'));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With