(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++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter7: User-defined Simple Data Types, Namespaces, And The String Type
Section: Chapter Questions
Problem 5SA
icon
Related questions
Question
Matlab help me quickly don't use AI please
(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:(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 with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr