akhanijow
Apr22-10, 07:38 PM
Hi everyone,
I am writing a matlab program and am having some issues. Here is the code I have written so far:
clear all
clc
info(1) = input('What is the MARR (%)? ');
info(2) = input('What is the lifetime of the project? ');
info(3) = input('What is the initial investment ($)? ');
m=0;
while m < info(2)
m = m+1;
info(4) = m;
info(5) = input('What is the maintenance cost for year',num2str(m),' ? ');
end
functionanswer = Evaluation(info);
disp('The Present Value of the project is');
disp(functionanswer(1));
For info(5), I am trying to make it say "what is the maintenance cost for year __?"
I have tried using num2str, and may other things but cant seem to get it! Any help would be great! Thanks!
I am writing a matlab program and am having some issues. Here is the code I have written so far:
clear all
clc
info(1) = input('What is the MARR (%)? ');
info(2) = input('What is the lifetime of the project? ');
info(3) = input('What is the initial investment ($)? ');
m=0;
while m < info(2)
m = m+1;
info(4) = m;
info(5) = input('What is the maintenance cost for year',num2str(m),' ? ');
end
functionanswer = Evaluation(info);
disp('The Present Value of the project is');
disp(functionanswer(1));
For info(5), I am trying to make it say "what is the maintenance cost for year __?"
I have tried using num2str, and may other things but cant seem to get it! Any help would be great! Thanks!