Question

A matrix named mach contains 3 columns of data concerning the energy output of several machines....

A matrix named mach contains 3 columns of data concerning the energy output of several machines. The first column contains an ID code for a specific machine, the second column contains the total amount of energy produced by that machine in calories, and the third column contains the amount of time required by that machine to produce the energy listed in column 2 in hours.
Write a MATLAB program that will:
a) Request the user for the matrix mach.
b) Return a new matrix named P containing 2 columns and the same number of rows as mach.The first column should contain the machine ID codes, and the second column should contain the average power generated by each machine in units of watts.
A matrix named mach contains 3 columns of data con
0 0
Add a comment Improve this question Transcribed image text
Answer #1

n=input('Enter number of entries');

disp('Now enter values one by one');

x=zeros(n,1);

y=zeros(n,1);

z=zeros(n,1);

for i=1:n

x(i)=input('Enter ID');

y(i)= input('Enter energy');

z(i)=input('Enter time required');

end

mach=[x y z];

%1 Joule=4.184 Cal

%Power in Watt=energy in J/Time in Sec=y*(1/4.184)/Z

%1 Watt hour=Power in watt/time in hours

%simplifying we get, Watt hour=y/(4.184*3600)

P=[x y./(4.184*z*3600)];

%P_watthour=[x y/(4.184*3600)];

disp(P);

Add a comment
Know the answer?
Add Answer to:
A matrix named mach contains 3 columns of data concerning the energy output of several machines....
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
  • With Matlab Please Transplant data The data file “transplants.txt” contains the # of transplants performed each...

    With Matlab Please Transplant data The data file “transplants.txt” contains the # of transplants performed each year by different states in the country. Here’s the first few lines of the file: 0, 2015,2014,2013,2012,2011,2010,2009,2008,2007,2006,2005,2004,2003,2002,2001,2000 1,40,401,413,372,422,433,411,428,476,493,493,403,492,454,464,5272,109,711,754,652,735,618,590,601,607,511,498,421,354,376,341,2893,20,123,156,161,155,159,173,158,171,183,185,154,119,122,103,110 . . . Each row is a different state, and each column (starting at column 2)is a different year; the first column is the state #, and the states are always listed 1, 2, 3, ... . The first row of the file is a header...

  • problem2, the file "Test_Data.xlsx" contains in cylinder pressure data from a firing engine. the data is...

    problem2, the file "Test_Data.xlsx" contains in cylinder pressure data from a firing engine. the data is resolved in crank angle degree and is taken every 1/2 degree. O tittps/ualearn blackboard.com/bbcswebdav/pid plot a new function on the same graph overwriting the orizinal function 1 of11ρ Functions to choose from: y A sin(Bx C)+ D y A sin2(Bx+ C) + D y A In(Bx + C)D y A exp(Bx + C)+ D ž. The file "Test Data.xlsx" contains in-cylinder pressure data from...

  • Introduction to Engineering I Spring 2019 MATLAB Homework Assignment 1 a) Create a matrix called ...

    help wanted? Introduction to Engineering I Spring 2019 MATLAB Homework Assignment 1 a) Create a matrix called d from the third column of matrix a. (Hint, typing d 22: 5: 821 b) Combine matrix b and matrix d to create matrix e, a two-dimensional matrix with three rows c) Combine matrix b and matrix d to create matrix f, a one-dimensional matrix with six rows and d) Create matrix g from matrix a and the first three element of matrix...

  • This is a simple program that I'm struggling with. Java is not my forte... It's way...

    This is a simple program that I'm struggling with. Java is not my forte... It's way too verbose for my liking. Anyways... The criteria for the prog is as follows: No issues with the GUI, I can do this on my own, but for a reference see the following: A combo box should allow the user to select one of the four database actions shown. The database should be implemented as a HashMap, with the ID field as the key...

  • Assignment Draw a flowchart, using Microsoft Visio or LucidChart, to document the logic required to complete...

    Assignment Draw a flowchart, using Microsoft Visio or LucidChart, to document the logic required to complete this program Save the flowchart as a PDF file Develop a C++ program, following the logic in your flowchart, to convert a series of whole number decimal values to their Roman equivalent. Develop a function that will accept a whole number value in the range 1-9999 and return a string containing the long-form Roman Numeral equivalent of the input value, consisting only of upper-case...

  • write a code on .C file Problem Write a C program to implement a banking application...

    write a code on .C file Problem Write a C program to implement a banking application system. The program design must use a main and the below functions only. The program should use the below three text files that contain a set of lines. Sample data of these files are provided with the assessment. Note that you cannot use the library string.h to manipulate string variables. For the file operations and manipulations, you can use only the following functions: fopen(),...

  • Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture...

    Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture i sent is the first page 5. Write and save a function Sphere Area that accepts Radius as input argument, and returns SurfaceArea (4 tt r) as output argument. Paste the function code below. Paste code here 6. Validate your Sphere Area function from the command line, checking the results against hand calculations. Paste the command line code and results below. 7. Design an...

  • Mountain Paths (Part 1) Objectives 2d arrays Store Use Nested Loops Parallel data structures (i.e...

    Mountain Paths (Part 1) in C++ Objectives 2d arrays Store Use Nested Loops Parallel data structures (i.e. parallel arrays … called multiple arrays in the zyBook) Transform data Read from files Write to files structs Code Requirements Start with this code: mtnpathstart.zip Do not modify the function signatures provided. Do not #include or #include Program Flow Read the data into a 2D array Find min and max elevation to correspond to darkest and brightest color, respectively Compute the shade of...

  • engineering computation 4. You were just hired for a summer internship with one of the area's...

    engineering computation 4. You were just hired for a summer internship with one of the area's best software compa- nies; however, on your first day of work you learn that for the next three months, the only job you will have is to convert binary (base 2) numbers into decimal numbers (base 10). You decide to write a script that will repeti- tively ask the user for a binary number and return its decimal equivalent until an illegal number (one...

  • IN C++ Please!! Declare a global integer constant called SIZE and initialize it to 10. •...

    IN C++ Please!! Declare a global integer constant called SIZE and initialize it to 10. • Declare a global enum variable that will support 10 values – each representing an ant colony {A, B, C, D, E, F, G, H, I, J}. • In the main function, o Declare a 2-dimensional array of size the global integer constant, SIZE. The number of rows and columns should be equal to SIZE, which would make this a square matrix. This array will...

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
ADVERTISEMENT