Hi everyone,(adsbygoogle = window.adsbygoogle || []).push({});

I am writing a matlab program and am having some issues. Here is the code I have written so far:

Code (Text):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!

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab while loop, Please help!

Loading...

Similar Threads - Matlab while loop | Date |
---|---|

Python How can I run Python by getting values from Matlab | Mar 7, 2018 |

What is each step of this Matlab program doing? | Feb 21, 2018 |

C/++/# Help with MATLAB code? | Feb 9, 2018 |

Why does entering '0' terminate do-while loop here? | Feb 2, 2018 |

Numerical Integration with variable limits MATLAB | Jan 15, 2018 |

**Physics Forums - The Fusion of Science and Community**