I want so simplify a certain value(a number) but when I use vpa(debt) I get this error [ Undefined function 'vpa' for input arguments of type 'double'.]

4 visualizaciones (últimos 30 días)
clear;
money_borrowed= 1000
m = money_borrowed
annual_interest= 10/100
a = annual_interest
time_passed_for_payment_in_year= 2
t = time_passed_for_payment_in_year
debt= m * (1+ a/12)^(12*t)
s=vpa(debt)

Respuesta aceptada

Walter Roberson
Walter Roberson el 11 de Ag. de 2021
Editada: Walter Roberson el 11 de Ag. de 2021
format bank
Q = @(v) sym(v); %convert number to symbolic number
money_borrowed = Q(1000)
money_borrowed = 
1000
m = money_borrowed
m = 
1000
annual_interest= Q(10)/100
annual_interest = 
a = annual_interest
a = 
time_passed_for_payment_in_year = Q(2)
time_passed_for_payment_in_year = 
2
t = time_passed_for_payment_in_year
t = 
2
debt= m * (1+ a/12)^(12*t)
debt = 
s = double(debt);
s
s =
1220.39

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by