Error using input Unrecognized function or variable 't'.
Show older comments
Hi everyone, can you help me fix this problem
***This is my matlab code
clear all
clc
prompt1='Her retirement increases by R1 % per year ';
prompt2='Plus R2 % of her yearsalary ';
prompt3='Time she started working ';
prompt4='Her salary S(t) increase exponentially after t years';
R1= input(prompt1);
R2= input(prompt2);
p= input(prompt3);
S= input(prompt4);
syms A(t)
ode = diff(A,t) -R1*A == R2*S;
cond = A(0) == 0;
ASol(t) = dsolve(ode,cond);
ASol(p)
***And when i put number and run
Her retirement increases by R1 % per year
0.06
Plus R2 % of her yearsalary
0.12
Time she started working
40
Her salary S(t) increase exponentially after t years
30*exp(t/20)
Error using input
Unrecognized function or variable 't'.
Error in untit5led (line 11)
S= input(prompt4);
Her salary S(t) increase exponentially after t years
***Thank you very much.
Accepted Answer
More Answers (0)
Categories
Find more on Conversion Between Symbolic and Numeric in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!