How to create a convergence table
이전 댓글 표시
I was asked to create a convergence table in matlab but i dont understand how to make one in matlab.

답변 (1개)
Shlok
2024년 12월 11일
0 개 추천
Hi Karolina,
I understand that you want to make a convergence table in MATLAB. I suggest you the following approach for the same:
- First, start by setting up your initial parameters like the “T”, “K”, and the time step “dT”.
- Define the grid “S” as specified, which includes various points where you'll calculate the option values.
- For each point in the grid, calculate the option value at time “t = 0” and “S = 100” using a pricing model such as Black-Scholes or a binomial tree. You can use MATLAB functions like “linspace” to create segments of your grid and “arrayfun” to apply the pricing model across the grid points.
- Store these calculated option values in a table format to show how the values converge as the grid points and time steps vary.
Refer to the following documentation links to know more about various functions useful in the above approach:
- linspace: https://www.mathworks.com/help/matlab/ref/double.linspace.html
- arrayfun: https://www.mathworks.com/help/matlab/ref/arrayfun.html
- tables: https://www.mathworks.com/help/matlab/tables.html
Also, the above question appears to be a homework question. To understand how to ask a homework question, you can go through the following MATLAB Answer:
카테고리
도움말 센터 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!