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?

답변 (1개)

the cyclist
the cyclist 2020년 6월 19일

0 개 추천

Did you try looking through the documentation for tables?

댓글 수: 5

Jane Smith
Jane Smith 2020년 6월 19일
I did and tried some aswell but it didnt work, I keep getting an error.
the cyclist
the cyclist 2020년 6월 19일
In that case, rather than asking us to explain everything about tables to you (because we don't really know what you do and do not understand), it is better to post your code, explain where you are stuck, and give the entire error message that you are getting.
To get your code to run at all, I had to make these two changes:
  • Change the variable Month to month, because MATLAB is case-sensitive
  • Fix the typo in the variable Remaing_Balance to be Remaining_Balance
But then I get the error:
Warning: It appears you are using an obsolete version of uitable.
See the documentation for correct uitable usage:
help uitable and doc uitable
For more information, click here
Error using uitable_deprecated
Unrecognized parameter:
Error in uitable (line 49)
[thandle, chandle] = uitable_deprecated(varargin{:});
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.
Jane Smith
Jane Smith 2020년 6월 19일
Had been working a 2 weeks on this, couldn't be any more grateful to you. Thanks alot.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

질문:

2020년 6월 19일

댓글:

2020년 6월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by