extract value of random matrix
古いコメントを表示
Hello everyone,
I face a problem and I can not find a way to solve it. My problem is the following:
I simulate a geometric Brownian and an exponential barrier. I am looking to extract the time of contact between my fence and my Brownian. I manage to get a matrix that takes the value 0 if my Brownian is superior and the value of time otherwise. And I would like to extract each value that is after a 0 and a 0 before each value. [0 0 0 1 2 3 4 5 0 0 0 6 0] I would like to extract 1 5 and 6 On a path I can do it with "find" but the idea that I reply I do not see how.
if someone has an idea thank you.
回答 (1 件)
Image Analyst
2015 年 3 月 21 日
0 投票
Trivial if you have the Image Processing Toolbox - do you? Otherwise use abs(diff(vector))) with some other code to make sure you don't get uniform areas inside the non-zero areas.
2 件のコメント
vachelard Valentin
2015 年 3 月 21 日
Image Analyst
2015 年 3 月 21 日
Too bad. Type "ver" on the command line to make sure you don't see it. Using diff() will be a lot more complicated if it's robust enough to handle all the strange cases you might encounter.
カテゴリ
ヘルプ センター および File Exchange で Financial Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!