필터 지우기
필터 지우기

is there an equivalent vlookup formula excel in matlab of a string?

조회 수: 1 (최근 30일)
fede
fede 2016년 4월 10일
댓글: Marc 2016년 4월 10일
I have the following matrix:
Stock_1 Stock_2 ..... Stock_n
23.5 25.8 29.6
24.5 85.5 ........ 59.2
.... .... ....
A matrix (nxn), where in the first row ther'is the name of stocks, and in the other row the historical price. Then, I have another matrix of pair of stocks, for example:
Stock_1 Stock_2
Stock_3 Stock_5
...... ......
and so on.... I want a for loop that give me for all pair the respective stock prince. For example for the first pair: Stock_1 Stock_2 I want to extrapolate the following matrix:
Stock_1 Stock_2
23.5 25.8
24.5 85.2
and so on. Thxs
  댓글 수: 1
Marc
Marc 2016년 4월 10일
Do you have a matrix or are you using a table?
If you have never used a table, I would recommend trying it for this type of data setup.

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

답변 (1개)

Image Analyst
Image Analyst 2016년 4월 10일
Try ismember().

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by