Task 1 (i) Write a user-defined MATLAB function that calculates the volume of a cylindrical water tank. The function should prompt the user to input the radius and height of the tank in meters. (ii) Write a MATLAB script that converts temperatures from Celsius to Fahrenheit. The script should ask the user how many temperatures they want to convert, prompt the user to input each temperature in Celsius, and then display the corresponding temperature in Fahrenheit. The script should display the results in a table format using 'fprintf' to show both Celsius and Fahrenheit values for each input. (iii) Square numbers are a sequence of numbers that can be represented in the form of a square grid. The first square number is 1, which represents a single dot. The second square number is 4, which represents a 2x2 grid of dots. The third square number is 9, which represents a 3x3 grid of dots, and so on. 1 4 9 Figure 1 Calculate the first 10 square numbers starting from 1 using MATLAB and display them as square grids of asterisks "*" similar to the display in Figure 2, using the 'plot' function. * ** *** *** Figure 2

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.6: Nested Loops
Problem 2E
icon
Related questions
Question
MATLAB Please don't use AI provide screen shot for output and code Quickly
Task 1
(i) Write a user-defined MATLAB function that calculates the volume of a cylindrical water
tank. The function should prompt the user to input the radius and height of the tank in
meters.
(ii) Write a MATLAB script that converts temperatures from Celsius to Fahrenheit. The
script should ask the user how many temperatures they want to convert, prompt the user
to input each temperature in Celsius, and then display the corresponding temperature in
Fahrenheit.
The script should display the results in a table format using 'fprintf' to show both Celsius
and Fahrenheit values for each input.
(iii) Square numbers are a sequence of numbers that can be represented in the form of a
square grid. The first square number is 1, which represents a single dot. The second
square number is 4, which represents a 2x2 grid of dots. The third square number is 9,
which represents a 3x3 grid of dots, and so on.
1
4
9
Figure 1
Calculate the first 10 square numbers starting from 1 using MATLAB and display them
as square grids of asterisks "*" similar to the display in Figure 2, using the 'plot' function.
* **
***
***
Figure 2
Transcribed Image Text:Task 1 (i) Write a user-defined MATLAB function that calculates the volume of a cylindrical water tank. The function should prompt the user to input the radius and height of the tank in meters. (ii) Write a MATLAB script that converts temperatures from Celsius to Fahrenheit. The script should ask the user how many temperatures they want to convert, prompt the user to input each temperature in Celsius, and then display the corresponding temperature in Fahrenheit. The script should display the results in a table format using 'fprintf' to show both Celsius and Fahrenheit values for each input. (iii) Square numbers are a sequence of numbers that can be represented in the form of a square grid. The first square number is 1, which represents a single dot. The second square number is 4, which represents a 2x2 grid of dots. The third square number is 9, which represents a 3x3 grid of dots, and so on. 1 4 9 Figure 1 Calculate the first 10 square numbers starting from 1 using MATLAB and display them as square grids of asterisks "*" similar to the display in Figure 2, using the 'plot' function. * ** *** *** Figure 2
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage