error with bndprice command
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello,
I always got the error 'CouponRate is required for all Bond instruments.' when using the bndprice command and I don't know what is wrong.
A=[0.02:0.005:0.05]
B=zeros(numel(A),2)
for i=1:numel(A)
[intrinsicValue,accruedInterest]=bndprice(0.045,A(i),'01-Mei-2016','30-Jun-2021')
B(i,1)=intrinsicValue
B(i,2)=accruedInterest
end
plot(B(1),B(2))
Thanks in advance
댓글 수: 0
채택된 답변
Walter Roberson
2021년 3월 27일
Your spelling of May was not being recognized.
A=[0.02:0.005:0.05]
B=zeros(numel(A),2);
for i=1:numel(A)
[intrinsicValue,accruedInterest]=bndprice(0.045,A(i),'01-May-2016','30-Jun-2021');
B(i,1)=intrinsicValue;
B(i,2)=accruedInterest;
end
B
plot(B(:,1),B(:,2))
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Price and Analyze Financial Instruments에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!