Question

In: Mechanical Engineering

Working with MATLAB arrays. You can check your answers on MATLAB but do not include a...

Working with MATLAB arrays. You can check your answers on MATLAB but do not include a script file or MATLAB output for this problem . Just write the commands you would use each part. You may not 'hard code' which means you cannot just write in the answers. Show the MATLAB commands You have the following array: Data1[ 3.6 8.9 2.5 4.6 12.0 3.3 7.8 1.5]

A) Write the command(s) you would use to order the values in the array Datal in ascending order and store them back in Data1.

B) B) Using the same array Data 1, write the command(s) to copy the 5 lowest values of Datal and save them in an array Data2. Use a command for this. Do not hard code Data2= [1.5 2.5 3.3 3.6 4.6]

C) Create an array Data3 that cuves each value in Data1 and store them in Data3

D) Create an array Data4 thag adds 5 to each value in Data 1

E) Create an array Data5 that uses the same values in Data1 in a vertical array

Solutions

Expert Solution

Command use
A sort(Data1) It's short the array in ascending order
B mink(Data1,5) It store 5 minimum element of Array
C power(Data1,3) It cube element of Array
D plus(Data1,5) It add 5 to all element of Array
E transpose(Data1) it transpose the array

Also the matlab code for your reference and its output

CODE:

clc;clear all;
Data1=[3.6 8.9 2.5 4.6 12.0 3.3 7.8 1.5];
%%A Sort low to high
Data1=sort(Data1);
display([Data1]);
%%B 5 Lowest values
Data2=mink(Data1,5);
display(Data2);
%%C cubes of Each element
Data3=power(Data1,3);
display(Data3);
%%D Add 5 to each element
Data4=plus(Data1,5);
display(Data4);
%%E Vetical array
Data5=transpose(Data1);
display(Data5);

-Output:

Data1 =

1.5 2.5 3.3 3.6 4.6 7.8 8.9 12


Data2 =

1.5 2.5 3.3 3.6 4.6


Data3 =

3.375 15.625 35.937 46.656 97.336 474.55 704.97 1728


Data4 =

6.5 7.5 8.3 8.6 9.6 12.8 13.9 17


Data5 =

1.5
2.5
3.3
3.6
4.6
7.8
8.9
12

Hope the answer is helpful for any doubt comment below i will solve your query and rate my answer your rating is important to us.


Related Solutions

can you check if my answers are correct and can you please type the correct answers...
can you check if my answers are correct and can you please type the correct answers for each question 5 points) Trevor is interested in purchasing the local hardware/electronic goods store in a small town in South Ohio. After examining accounting records for the past several years, he found that the store has been grossing over $850 per day about 60% of the business days it is open. Estimate the probability that the store will gross over $850 at least...
1.include working in your answers 1a) If a long wire is carrying a current of 5.5...
1.include working in your answers 1a) If a long wire is carrying a current of 5.5 A, how far away from the wire would the magnet field strength be 1.0E-5 T? 1b) A transformer is used to step down from the New Zealand mains voltage of 230 V to 110 V for use with an electric razor from the USA. (i) If the razor draws a current of 0.25 A what current (at least) is drawn from the 230 V...
Can you please check my answers and if I am wrong correct me. Thank you! A....
Can you please check my answers and if I am wrong correct me. Thank you! A. In today's interconnected world, many central banks communicate regularly and frequently with the public about the state of the economy, the economic outlook, and the likely future course of monetary policy. Communication about the likely future course of monetary policy is known as "forward guidance.". If the central bank increases the reserve ratio, as the market has perfectly expected, which of the following will...
THIS IS THE THIRD TIME ASKING THE SAME QUESTION, PLEASE DOUBLE CHECK YOUR ANSWERS. THANK YOU....
THIS IS THE THIRD TIME ASKING THE SAME QUESTION, PLEASE DOUBLE CHECK YOUR ANSWERS. THANK YOU. AND ANSWER ALL PARTS A, B AND C The USA Today reports that the average expenditure on Valentine's Day is $100.89. Do male and female consumers differ in the amounts they spend? The average expenditure in a sample survey of 44 male consumers was $135.67, and the average expenditure in a sample survey of 32 female consumers was $68.64. Based on past surveys, the...
Hello there, I'm wondering can you do this problem without arrays? Using the given code on...
Hello there, I'm wondering can you do this problem without arrays? Using the given code on C++ Platform. Let me know ASAP. #include <iostream> #include <time.h> using namespace std; void shoot(bool &targetAlive, double accuracy) { double random = (rand() % 1000) / 1000.; targetAlive = !(random < accuracy); } int startDuel(int initialTurn) { bool personAlive[3] = {true, true, true}; double accuracy[3] = {0.333, 0.5, 1.0}; int turn = initialTurn; // which person has to shoot, initialTurn represents the first person...
*Be sure to show work that supports your answers. *Include appropriate units in your answers. 3....
*Be sure to show work that supports your answers. *Include appropriate units in your answers. 3. (10 points) Pass rates for Math 355 at ARC have been 61.5%. In an effort to improve pass rates in the course, faculty piloted a mastery-based learning model where course content was delivered in a lab through a computer program. Students could either voluntarily enroll in the pilot program or they could take one of the other traditional classes. Of the 120 students who...
I just wanted to double check my answers, can you just provide me with the correct...
I just wanted to double check my answers, can you just provide me with the correct answer for each one in order to cross-check, thank you. The United States' class system is heavily dependent upon an individual's social background. True False At which level of the factors which put women at risk does the following statement fit? "Tolerance of violence as a means of conflict resolution". Family/Relationship Level Individual Level Community Level Societal Level Which of the following countries is...
I just wanted to double check my answers, can you just provide me with the correct...
I just wanted to double check my answers, can you just provide me with the correct answer for each one in order to cross-check, thank you. When women carry the burden of poverty and are treated as non-equals when compared to men, which of the following terms describes this circumstance? Twice Burdened Double Discrimination Double Deprivation Double Jeopardy Which of the following countries was not a colony of Britain? Singapore Korea Hong Kong In 2012, which country utilized 2.8% of...
You have been working with the arrays for the past few weeks and you have learned...
You have been working with the arrays for the past few weeks and you have learned their limitations. In this assignment, you will be using a new data structure, HashMaps, to repeat Assignment 8.3. Main Method (5 points) Declare and initialize an HashMap with values of type of type Employee, and keys of type integer. In a while loop, keep initializing objects of type Employee, storing them in the HashMap, and allow the user to enter ID, salary, and leaveDays...
If your answer does not match the answers given below, check with the instructor. There is...
If your answer does not match the answers given below, check with the instructor. There is always the chance, albeit small, that your answer is correct and there is a typo below.) 1.         Bank A offers to lend you money at 10 percent compounded monthly, Bank B at 11 percent compounded quarterly, and Bank C at 12 percent compounded annually. Calculate the effective rates and state which bank offers the lowest cost of borrowed capital. 2.         What are the interest...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT