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

Darshan Ramakant Bhat
Darshan Ramakant Bhat 2017년 10월 10일
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:

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

답변 (0개)

카테고리

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

질문:

2017년 10월 7일

댓글:

2017년 10월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by