Borrar filtros
Borrar filtros

How can i create a table?

2 visualizaciones (últimos 30 días)
Jane Smith
Jane Smith el 19 de Jun. de 2020
Comentada: Jane Smith el 19 de Jun. de 2020
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?

Respuestas (1)

the cyclist
the cyclist el 19 de Jun. de 2020
Did you try looking through the documentation for tables?
  5 comentarios
the cyclist
the cyclist el 19 de Jun. de 2020
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 el 19 de Jun. de 2020
Had been working a 2 weeks on this, couldn't be any more grateful to you. Thanks alot.

Iniciar sesión para comentar.

Categorías

Más información sobre Structures en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by