9th Day of training program was the last day of Module1 (MATLAB Basics). The starting of the day was by recapping all the topics covered in last Eight days.
Basically this day was dedicated for Hands on Sessions so the students can apply their MATLAB knowledge to solve various technical problems as well as their daily life problems.
I am sharing few of the problems with their solution to my readers.
The population in the United States after 1980 can be approximated by the following equation:
where n represents the number of years after 1980. Write a MATLAB Program that can Estimate the population in the United States for a given year.
year= input(‘Enter the year to calculate population: \n’);
fprintf(‘ The population in the year %d is %d \n’,year,p)
Write a MATLAB program that estimates your electricity bill, if the appliances with the kilowatt consumption are shown below in the Table and the cost per kilowatt-hour of usage charge by the power provider is Rs.5.
Electrical Power Consumption
Refrigirator 0.5 kW
Microwave Oven 1.0 kW
TV 0.2 kW
Washing Machine 0.5 kW
Iron 1.25 kW
Toaster 1.3 kW
AC 1.5 kW
disp(‘Welcome to the utility for Electricity Bill Calculation \n’);
ref= input(‘Enter the uses of Refrigirator in hours per day: \n’);
micro= input(‘Enter the uses of Microwave oven in hours per day: \n’);
tv= input(‘How many hours you watch the TV per day: \n’);
wm= input(‘How many hours you use the Washing Machine per day: \n’);
iron= input(‘Enter the uses of Iron in hours per day: \n’);
tost= input(‘Enter the uses of Toster in hours per day: \n’);
ac= input(‘Enter the uses of Air Conditioner in hours per day: \n’);
in1= input(‘Enter the name of month for Billing:’,’s’);
in2= input(‘Enter the no. of days in current month:’);
bill= total_KW*5; fprintf(‘Your Electricity bill for the month %s is %f \n’,in1,bill);
Write a MATLAB program that returns the sequence consisting of square of the first 50 even numbers (0 4 16 36 64 100 … 9604), and identify and display the first, fifth, and tenth element of that sequence.
for ii= 2:2:100
fprintf(‘The square of %d element is: %d \n’,n,sqr(n));