Using both the command line and script file do the following problems 1. Run the
ID: 3891049 • Letter: U
Question
Using both the command line and script file do the following problems 1. Run the following script file e This program generates a table of conversions 8 from Celcius to Fahrenheit. strt = input ('Enter the starting temperature in Celcius: . ); inc input( Enter the increment between lines in Celcius: lines = input ('Enter the number of lines in the table: '); celcius strt: inc: stre+inc" (lines-1); fahr (9*celcius)/5 32 table ( : , 1) table ( : , 2) celcius' ; fahr"; = = disp('Temperature Conversion) disp('Celcius to Fahrenheit') disp (table) 2. Populations tend to expand exponentially, that is, wher P- current population -original population r-continuous growth rate, expressed as a fraction t- time If you originally have 100 rabbits that breed at a continuous growth raleof 90% (r 0.9) per year, find how many rabbits you will have at the end of 10 years 3. Run the following script fileExplanation / Answer
Problem 1:
Output :
Enter the starting temperature in Celcius: 30
Enter the increment between lines in Celcius: 5
Enter the number of lines in the table: 15
Temperature Conversion
Celcius to Fahrenheit
30 86
35 95
40 104
45 113
50 122
55 131
60 140
65 149
70 158
75 167
80 176
85 185
90 194
95 203
100 212
Prob 2:
% The script computes the population of rabbits
% P is the current population
% Initial number of rabbits
P0 = 100;
% breed at a continuous growth rate of 90%(0.9)
r =0.9;
% for a time 10 years
t = 10;
% Compute the current population of rabbits
P = P0 * exp(r*t);
fprintf('Initail population is %5.2f ',P0)
fprintf('Bread at a continuous growth of rate %1.2f ',r)
fprintf('Time period of %d years ',t)
fprintf('Total population of rabbits after 10 years is %5.2f ',P)
Output :
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.