Question

MatLab 2015: 18.4 Structures You are an expert on rating clothing and Acme Clothing Company has...

MatLab 2015:

18.4 Structures
You are an expert on rating clothing and Acme Clothing Company has hired you to rateits clothes.Clothes are to be represented as structures with the following fields:
ID, Condition, Color, Price, Comfort, Rating and Quality

Create a script that will create a structure array called acmeClothes that contains theclothes fields above. Create a user-defined subroutine that determines the rating andquality based on the following formulas:The Rating field in each structure should contain the calculated rating of that particulararticle of clothing:
Rating=5*Condition+3*Color+2*Price+9*Comfort
Each field is given a value from 1 to 5.The Quality field is a string that is:‘premium’ Rating > =80,‘good’>=60 and <80‘poor’.>= 20 and <60,liquidate for <=20.Run the script on the following input data set:ID Condition Color Price Comfort1 5 4 4 52 1 2 2 1Print the Quality of each clothing item as follows:ID            Quality===          =====1 Premium2 Poor
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution: Note: Solution is prepared based on given information The Matlab code is shown below Clear clear Clear clc &Clothes

color (i) clothes (3,i); %Extract price (i) price = clothes (4,i); %Extract comfort comfort (i) clothes (5,i); %End end %Extr

price %Display comfort comfort Display quality quality %Loop until end for i -1:5 %Compute rating rating (i)5*condition (i) 3

Sample Output: ID - 10 12 14 condition 15 10 13 color price = 13 14 comfort-

quality - Columns 1 through 3 standard premium standard Columns 4 through 5 premium medium rating 94 121 91 108 81

Code:

%Clear

clear

%Clear

clc

%Clothes

clothes = [10 12 11 14 5 ; 11 15 10 13 4 ; 5 5 5 5 5 ; 3 11 13 14 5 ;

2 1 0 0 4 ; 3 2 1 2 5 ];

%Loop until length

for i = 1:5

    %Extract cloth ID

    ID(i) = clothes(1,i);

    %Extract condition

    condition(i) = clothes(2,i);

    %Extract color

    color(i) = clothes(3,i);

    %Extract price

    price(i) = clothes(4,i);

    %Extract comfort

    comfort(i) = clothes(5,i);

  

%End

end

%Extract quality

quality = {'standard','premium','standard','premium','medium'};

%Display ID

ID

%Display condition

condition

%Display color

color

%Display price

price

%Display comfort

comfort

%Display quality

quality

%Loop until end

for i = 1:5

    %Compute rating

    rating(i) = 5*condition(i) + 3* color(i) + 2* price(i) + 9*comfort(i);

%End

end

%Display rating

rating

Add a comment
Know the answer?
Add Answer to:
MatLab 2015: 18.4 Structures You are an expert on rating clothing and Acme Clothing Company has...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Project 2 (Clothing Rental) Fashion Rental is a rental company located in Manhattan, New York, sp...

    Project 2 (Clothing Rental) Fashion Rental is a rental company located in Manhattan, New York, specializing in rental of high end wome en clothing for the fashion industry. Over the past 12 months, her business has experienced tremendous growth due to a boom in the fashion Industry. The business has kept the daily service records in a workbook format and now needs to expand its reporting capabilities to develop a relatio nal database to effect a more functional structure. Fashion...

  • Please answer my questions and provide the correct answers it is an emergency because nobody has...

    Please answer my questions and provide the correct answers it is an emergency because nobody has already answered my questions since I posted. Questions regarding MongoDB - Query. What are the answers to the following questions; you have to use the data document provided(database name: inventory, collection name: products), reading left to right. So basically, the data provided is a JSON file that you need to put in that database that you will create in MongoDB; therefore, I will put...

  • The ACME Manufacturing Company has hired you to help automate their production assembly line. Cameras have...

    The ACME Manufacturing Company has hired you to help automate their production assembly line. Cameras have been placed above a conveyer belt to enables parts on the belt to be photographed and analyzed. You are to augment the system that has been put in place by writing C code to detect the number of parts on the belt, and the positions of each object. The process by which you will do this is called Connected Component Labeling (CCL). These positions...

  • The Acme Trucking company has hired you to write software to help dispatch its trucks. One important element of this sof...

    The Acme Trucking company has hired you to write software to help dispatch its trucks. One important element of this software is knowing the distance between any two cities that it services. Design and implement a Distance class that stores the distances between cities in a two-dimensional array. This class contains the following required data members and methods: Required Data Members: String[] cities; //it is used to store city names int[][] distance; // this 2-D array repreents distance between two...

  • given below are the project description and their Html and css files i need javascript according...

    given below are the project description and their Html and css files i need javascript according to the project and other files! WEB230 - JavaScript 1 Assignment 6b - Event Delegation Before starting, study the HTML and open it in a browser so that you understand the structure of the document. You will add functionality to perform several tasks in our shopping list app. Clicking the red "X" at the right of an item will delete that item. Clicking on...

  • can you please follow all the instructions ? The answers that I got has either missing...

    can you please follow all the instructions ? The answers that I got has either missing range for loop or one funtion . Read the instructions carefully. At least 10% will be deducted if the instructions are not followed. For general lab requirements, see General Lab Requirements. Do not prompt the user for input during the execution of your program. Do not pause at the end of the execution waiting for the user's input. Notes 1. Your program should use...

  • Don't attempt if you can't attempt fully, i will dislike a nd negative comments would be...

    Don't attempt if you can't attempt fully, i will dislike a nd negative comments would be given Please it's a request. c++ We will read a CSV files of a data dump from the GoodReads 2 web site that contains information about user-rated books (e.g., book tit le, publication year, ISBN number, average reader rating, and cover image URL). The information will be stored and some simple statistics will be calculated. Additionally, for extra credit, the program will create an...

  • Don't attempt if you can't attempt fully, i will dislike and negative comments would be given...

    Don't attempt if you can't attempt fully, i will dislike and negative comments would be given Please it's a request. c++ We will read a CSV files of a data dump from the GoodReads 2 web site that contains information about user-rated books (e.g., book titnle, publication year, ISBN number, average reader rating, and cover image URL). The information will be stored and some simple statistics will be calculated. Additionally, for extra credit, the program will create an HTML web...

  • Case study Company Case Campbell Soup Company: Watching What You Eat You might think that a well-known, veteran consumer products company like the Campbell Soup Company has it made. After all, when pe...

    Case study Company Case Campbell Soup Company: Watching What You Eat You might think that a well-known, veteran consumer products company like the Campbell Soup Company has it made. After all, when people think of soup, they think of Campbell’s. In the $5 billion U.S. soup market, Campbell dominates with a 44 percent share. Selling products under such an iconic brand name should be a snap. But if you ask Denise Morrison, CEO of Campbell, she’ll tell you a different...

  • 50. Client-centeredness and humility might look like saying, "Tell me about what's most important to you...

    50. Client-centeredness and humility might look like saying, "Tell me about what's most important to you here." True False 51. Appropriate regression means introducing new tasks weekly. True False 52. Rewarding behaviors, not outcomes means focusing on measurements first. True False 53. A demonstration of your client's mental skills include: Going to the farmer's market, Following the "inner compass" Learning about protein All of the above are correct 54. During step 1 of the coaching process, aim to identify bright...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT