How do I get the Character Vector "Name" to display within the text in the fprintf statement?
Afficher commentaires plus anciens
I am pretty new to matlab coding so I apologize in advance for my crude code lol. I am having some trouble trying to get the name that was input to be displayed with the question of "How much do you make per year, Name?"
Name = input('Hello, What is your name?','s');
disp('Hi,');
disp(Name)
Age = input('What is your age?');
if Age <= 100
fprintf('Your%3.0f thats not that old!\n',Age)
end
Salary = input('How much do you make per year?\n',Name);
if Salary < 15000
fprintf('You need to get a better paying job!\n')
else Salary >= 15000;
fprintf('Thats not to bad...\n');
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!