Write the matlab code to create a vector containing elements

Assignment Help MATLAB Programming
Reference no: EM131208196

Lab

Objectives

? Learn how to create vectors and matrices in MATLAB

? Become familiar with some of the built-in MATLAB functions and how they work

Deliverables

? Submit your pre-lab answers in Bblearn under the Lab 2 pre-lab assignment area prior to the start of class.

1) The primary form of data in MATLAB is vectors. They can be one-dimensional (i.e., vectors), or two-dimensional (i.e., matrices).

a) Write the MATLAB code to create a 1x3 vector containing the elements [1,2,3]. Additionally, write the MATLAB code to create a 3x1 vector with the same elements.

b) Write the MATLAB code to create the vector [2,4,6,...,98,100] and store it in a variable named x(Hint: There is a shorthand notation for regularly spaced vectors).

c) Write the MATLAB code to create a 2x2 matrix containing the elements [1,2,3,4] (The order of the numbers do not matter).

2) MATLAB has several types of built-in math functions that can help you perform common operations.

a) Write the MATLAB code that takes the absolute value of -134.

b) Write the MATLAB code that stores a number 3*pi in a variable named x, then takes the cosine of x.

c) Functions can also be applied to vectors. Assume you have a vector y, which contains the elements [4,9,16]. Write the MATLAB code to take the square root of y. What should the result be?

Reference no: EM131208196

Questions Cloud

How electronic and internet marketing support imc objectives : How do electronic and Internet marketing support the IMC objectives? List the types of electronic marketing you would use if you were try to target members of the Baby Boomers, Gen X, Gen Y, and Gen Z.
Demonstrate mastery of positive team management : Demonstrate mastery of positive team management practice - write three pages with two references. Research, critique and discuss this article in the light of our topic.
How much loss does the corp recognize on the distribution : Jesse is an 80% shareholder of Jackson Corp. In year 1, Jesse contributed property with an adjusted basis of $30,000 and a FMV of $27,000 to Jackson in a transaction qualifying under Sec 351. In year 4, Jackson adopted a plan of complete liquidation ..
Michael porter business strategies : Which of Michael Porter's business strategies does SAMSUNG follow to stay competitive. Explain why you think it is the best business strategy to take, or should the company change to another business strategy. Please provide at least 300 words, ..
Write the matlab code to create a vector containing elements : Write the MATLAB code to create a 1x3 vector containing the elements [1,2,3]. Additionally, write the MATLAB code to create a 3x1 vector with the same elements.
How can a leader develop self-trust : 1) Have you ever wavered with your decision-making? Have you noticed it in others? 2) How can a leader develop self-trust?
Stock constituting-what is gain or loss : Lauren owns 3000 shares of Fenmore stock constituting 30% of its single class of stock. Lauren had acquired 1500 shares 5 years ago for $20,000, 1000 shares 3 years ago for $10,000, and 500 shares 1 year ago for $30,000. Fenmore completely liquidated..
What competency-based programs and internal opportunities : What impact will culture, mandated legal regulations, religion, politics, demographics, language, and economic stability have on Mary's IHRM strategic development plan and approach in a new country like Dubai?
Importance of cultural competence in nursing : NUR 502 - Theoretical Foundations for Nursing Roles and Practice - It should include purpose of paper and rationale for selection of specific cultural group. It would be appropriate to cite information from your textbook regarding the importance of..

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd