Question: MATLAB a) You design a simple program that finds the volume of a cube. It takes two inputs--a dimension and a string input that allows
MATLAB
a) You design a simple program that finds the volume of a cube. It takes two inputs--a dimension and a string input that allows for two modes: SI and English unit systems. The string input takes either the strings "SI" or "English" as arguments. If you want to see which string the user input, which command should you use?
b) You decide to modify your parts inventory system to work with MATLAB. You have the following parts, which you store in a data structure called parts:
parts={'10k resistor', '1k resistor', 'Ceramic capacitor', 'transistor'}
What command would you use to refer to the third part (which in this case happens to be a ceramic capacitor)?
c) You decide to reorganize your parts file to have one column of names and another of part numbers:
parts={'10K resistor',34; '1K resistor',65; 'Ceramic capacitor',98; 'Transistor',132}
What is the command that you would use to find the part number for the ceramic capacitor?
d) You decide to reorganize your parts file yet again to have a structure featuring parts and part numbers:
parts(1).name='10K resistor';
parts(2).name='1K resistor';
parts(3).name='Ceramic capacitor';
parts(4).name='Transistor';
parts(1).number=34;
parts(2).number=65;
parts(3).number=98;
parts(4).number=132;
What is the command that you would use to output the part number for the ceramic capacitor?
- These should be fairly simple questions, but I cannot seem to find examples in my MATLAB book. Hope you can help.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
