Webread, save data in a vector?
Show older comments
I'm new in matlab, our teacher in University not explain us anything. We have to read data about financial securities, getting them from site alphavantage. I got key and I executed webread; now, I've a variable which is a struct 1x1 within fields "MetaData" and "TimeSeries_Daily_"; in second struct, I have other struct with data abouts title with fields "x1_Open", "x2_High" ecc. I have to save data in Open in a vect, but I have no idea of what I have to do. Teahcer says us that we have to use str2num function, and i wrote these two lines:
if true
for fn = 'fields'
y = [str2num(data.(fn(i)).x4_Close y];
end
what did it mean?And how can i save data?
1 Comment
Darshan Ramakant Bhat
on 10 Oct 2017
It is very hard to get what exactly you want to do from the code snippet. Since you are very new to MATLAB, you can get start with learning about basic data types and loops in MALTAB.
MATLAB is very easy to learn and you can get started with some free video tutorials in the following link:
If you need help for any inbuilt functions like 'str2num', you can search them in the documentation. Additionally you can type
>>doc str2num
in the MATLAB command prompt to launch the doc automatically.
To answer the question specifically, str2num() will convert the character array to numeric array. Following doc link explains more about the same in detail:
Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!