Match 2 vectors

Hello everyone,
I have 3 vectors as follow:
A) Vvect = ones(1,251)';
B) Yvect = (V -((1-tau)*coupon/r) + ((1-tau)*coupon/r-sd)*(V/sd)^- x)*ones(251,1);
C) Evect = [1,2,3,4...241] (exogenous numbers)
I want to match vector C) and B) by changing vector A). I would like to iterate this and doing this for all 1 to 251 and save this into my vector Vvect. I don't knwo the command to match these 2 vectors with A) and also don't know how to loop this command.
Thank you for your help,

1 件のコメント

Alan
Alan 2011 年 3 月 30 日
I mean changing changing V in the vector B) and saving it into A)

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 3 月 30 日

0 投票

I don't understand what you would be looping over?
What you write looks to me that you want
Vvect = Evect ./ Yvect;
Ah, your amendment just came through and now I'm more confused about what you want!

3 件のコメント

Alan
Alan 2011 年 3 月 30 日
Sorry let me reformulate my question.
I have a formula to find the value of the market cap which is the following:
SV = (V -((1-tau)*coupon/r) + ((1-tau)*coupon/r-sd)*(V/sd)^-x));
I have a list of 251 data for SV and my goal is to match SV with the formula on the right side by changing V. I have to loop this for all different SV's. therefore my goal is to get a matrix 251X1 with all the V's that makes SV equals to the formula on the right side. Do you understand now?
This is very much like the solver command in excel where you can choose to match 2 variables by changing another one.
Walter Roberson
Walter Roberson 2011 年 3 月 30 日
You have an extra ) in that SV expression.
What are some typical values for x ? If x is a positive integer then you get a polynomial of order x+1; if x is a negative integer then you get a polynomial of order x.
Alan
Alan 2011 年 3 月 30 日
r = 0.0023;
coupon = 34843000;
tau = 0.1;
sd = 13215051584;
sig = 0.01208;
x = 31.52702666;
X is a constant V is the one that will change for every iteration. Is that clear enough?

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangePerformance and Memory についてさらに検索

質問済み:

2011 年 3 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by