How can i create a table?
조회 수: 1 (최근 30일)
이전 댓글 표시
I need to create a table from a function of inputs and outputs of vectors of loan repayments. What is the layout of the commands i need to use to create a table?
댓글 수: 0
답변 (1개)
the cyclist
2020년 6월 19일
댓글 수: 5
the cyclist
2020년 6월 19일
I tried to get as close to what your code was doing as I can:
function [T] = loan(P,i,n)
Month = (1:n)';
for m = Month
Monthly_Amount(m,1)=P*i/(1-(1+i)^-n);
Payment_Interest_Content(m,1)=i*P;
Capital_Repaid(m,1)=i*n;
Remaining_Balance(m,1)=P-i;
end
T = table(Month,Monthly_Amount,Payment_Interest_Content,Capital_Repaid,Remaining_Balance);
end
Note that I just created a table, not a UI table.
참고 항목
카테고리
Help Center 및 File Exchange에서 Downloads에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!