Write a script file that when executed greet you displays th
Write a script file that when executed, greet you, displays the date and time and course of yourr favorite professor using matlab
Solution
greet.m------
fprintf(\"Hello John\")
time = clock;
year = time(1);
month = time(2);
day = time(3);
hours = time(4);
minutes = time(5);
seconds = time(6);
seconds = round(seconds);
fprintf(\'Date: %d-%d-%d\ \',day,month,year)
fprintf(\'Time: %d:%d:%d\ \',hours,minutes,seconds)
fprintf(\'my favourite professor teaches Maths\')
Here clock is a built in function
