Question

In: Computer Science

*MATLAB* Ch8E23 Design a nested struct to store information on constellations for a rocket design company....

*MATLAB*

Ch8E23

Design a nested struct to store information on constellations for a rocket design company. Each structure should store the constellation's name and information on the stars in the constellation. The structure for the star information should include the star's name, core temperature, distance from the sun, and whether it is a binary star or not. Create variables and sample data for your data structure.

Solutions

Expert Solution

Matlab code:

rocket1.consname='Rocket 1'; %first variable of rocket1
rocket1.information.starname='Star 1';
rocket1.information.coretemp=12000;
rocket1.information.dist=3000;
rocket1.information.bin='yes';

rocket2.consname='Rocket 2'; %first variable of rocket2
rocket2.information.starname='Star 2';
rocket2.information.coretemp=13000;
rocket2.information.dist=3500;
rocket2.information.bin='no';

disp(rocket1)
disp(rocket2)

Screenshot:

Output:

If you have any queries, please comment below.

Please upvote , if you like this answer.


Related Solutions

Code in python: Write a class that implements a struct. In your struct store Student information...
Code in python: Write a class that implements a struct. In your struct store Student information such as name, netid, and gpa. Write a function that can access a student in a list of 5 structs by netid and print their name and gpa. Show that your function works by calling it.
To store the information about a city and its weather forecast, create a struct that holds...
To store the information about a city and its weather forecast, create a struct that holds the city's name (string), population (int), and a forecast array storing 7 string elements representing the city's weather in the next 7 days. The program will then accept user input to enter the name and population of the city, then it accepts 7 string inputs to store into the forecast array. Then the program will output the city's name, population, and forecast data. Ex:...
C++ programming To store the information about a city and its weather forecast, create a struct...
C++ programming To store the information about a city and its weather forecast, create a struct that holds the city's name (string), population (int), and a forecast array storing 7 string elements representing the city's weather in the next 7 days. The program will then accept user input to enter the name and population of the city, then it accepts 7 string inputs to store into the forecast array. Then the program will output the city's name, population, and forecast...
MATLAB is program Respond fast please a quiz Create a MATLAB script. Using nested for loops,...
MATLAB is program Respond fast please a quiz Create a MATLAB script. Using nested for loops, evaluate the multivariable function: z = sin ⁡ ( x ) cos ⁡ ( y ) for x between -4 and 4 in steps of 1 y between -2 and 2 in steps of 1 Display the matrix z Cut and paste the following into a word doc and submit to this question. Your script code Your input Your output
Write a program that declares a struct to store the data of a football player (player’s...
Write a program that declares a struct to store the data of a football player (player’s name, player’s position, number of touchdowns, number of catches, number of passing yards, number of receiving yards, and the number of rushing yards). Declare an array of 10 components to store the data of 10 football players. Your program must contain a function to input data and a function to output data. Add functions to search the array to find the index of a...
Fashion design Company Ltd. sells clothing. The store sells dresses, skirts and blouses. Financial Statement information...
Fashion design Company Ltd. sells clothing. The store sells dresses, skirts and blouses. Financial Statement information for the clothing is as follows –                                                                         Dresses                       Skirts               Blouses Sales Revenue                                               300,000                       250,000           600,000 Variable costs                                                 170,000                       200,000           300,000 Contribution Margin                                        130,000                         50,000           300,000 Fixed costs                                                        80,000                         60,000           120,000 Net Income                                                     50,000                       (10,000)           180,000 Unavoidable fixed costs of $150,000 were allocated to the garments based on their respective sales revenues....
create a function in matlab that sums two m x n matrices using nested loops, then...
create a function in matlab that sums two m x n matrices using nested loops, then returns result into a new matrix. Use nesed for loops to add matrices piece by piece. Basically means, dont program simply A+B Function should perform error check to make sure both matrices have same number of rows/ columns.
Using Matlab: Using nested for loops (other methods are not allowed), write a function which takes...
Using Matlab: Using nested for loops (other methods are not allowed), write a function which takes as input a matrix, and as output returns true if at least one entry in the matrix is strictly greater than 8 and returns false otherwise.
Using Matlab Write a program that print the following matrix. (hint: use nested for-loop and if-statement)...
Using Matlab Write a program that print the following matrix. (hint: use nested for-loop and if-statement) mat = [2 -1 0 0 0 -1 2 -1 0 0 0 0 -1 2 -1 0 0 0 -1 2];
To complete this task you are required to design an information system for Fashion clothing store...
To complete this task you are required to design an information system for Fashion clothing store to assist with their business. You have discussed Porter’s Value Chain in class and you should understand the Primary and support activities within businesses. For this task you need to concentrate on Marketing and Sales only. The development of your professional skills includes researching information systems to assist with organisational issues that are encountered in contemporary business. You will be learning important ‘agile’ skills...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT