Write a script to solve the problems using vector operations

Assignment Help MATLAB Programming
Reference no: EM13698105

Question: Write a script to solve the subsequent problems using only vector operations:

a. Assume you have two vectors named A1 and B1 of equal length and create a vector C1 that combines A1 and B1 such that C1 = [A1(1) B1(1) A1(2) B1(2) . . . . A1(end) B1(end)].

For example, if A1 = [2, 4, 8] and B1 = [3, 9, 27], c1 should contain [2, 3, 4, 9, 8, 27]

b. Assume that you have two vectors named A2 and B2 of different lengths. Create a vector C2 that combines A2 and B2 in a manner similar to part a. However, if you run out of elements in one of the vectors, C2 also contains the elements remaining from the longer vector.

For example: if A2 = [1, 2, 3, 4, 5, 6] and B2 = [10, 20, 30], then C2 = [1, 10, 2, 20, 3, 30, 4, 5, 6] if A2 = [1, 2, 3] and B2 = [10, 20, 30, 40, 50], then C2 = [1, 10, 2, 20, 3, 30, 40, 50]

Be sure to include comments. Comments should be included in the program to explain your calculations and program.

 

Reference no: EM13698105

Questions Cloud

2s complement representation : How would you take a decimal number and make it a word-length 2's complement representation?
What is the difference between the behaviors of lband lbu : What is the difference between the behaviors of lband lbu and Give a code fragment that would place the perimeter of the rectangle in r6.
When a process creates a new process using the fork command : When a process creates a new process using the fork command, which of the subsequent is shared between the parent process and the child process?
Signed-magnitude representation of the similar number : Solution the question below, using the ID to identify the number you wish to specify as the correct answer. Place answer in blank provided.
Write a script to solve the problems using vector operations : Write a script to solve the subsequent problems using only vector operations - Assume you have two vectors named A1 and B1 of equal length and create a vector C1 that combines A1 and B1 such that C1 = [A1(1) B1(1) A1(2) B1(2) . . . . A1(end) B1(end..
Reading in strings from a text file into an array : If I am reading in strings from a text file into an array, where do I place this file at so that CodeBlocks will find it?
Describe techniques for optimizing web form usability : Imagine that a local college hired you to look at a lengthy form on the university's office of admissions Website. Prospective students have been calling the office to request information instead of utilizing the university's Website.
Complete set of logic gates : Do 2-input AND gates which have one input inverted form a complete set of logic gates? Rationalize your answer.
What is the output of the following program : What is the output of the following program and please explain it how did you get the answer or the output and the reason. void f(int i ) { if ( i = 4 ll i = 5 )/ Line 1 { cout

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Write a matlab program to generate a data file

1.) Write a Matlab program to generate a data file containing the names and corresponding telephone numbers of the customers. 2.) Using the data file created, write a program in Matlab to create a menu-driven facility to preform the following tasks

  Secant method to tryt to find out the root

create a function that will use the secant method to tryt to find out the root

  The function should compute and return

Define a function that takes as input parameters a function handle f, start and end values a and b, and a number of steps n. The function should compute and return the x and y values of the maximum of the function over the range a to b.

  Develop a simulation program

Develop a simulation program

  Compute and plot 4 mean temperature profiles

Generate by measdata.m an array A withsize (365,24), containing temperature measurements for an entire year [1 January,..., 31 December], 24 hours a day [00.00h,...,23.00h].

  Build a matlab birthday cake using the cylinder

Prepare for Project you should carefully read the Notes on Trajectory Formation that are available on Moddle.  As you read them, you should try out the concepts in MATLAB.

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  The concentration of medication in the blood declines

After a dose, the concentration of medication in the blood declines due to metabolic processes. The half-life of a medication is the time required after an initial dosage for the concentration to be reduced by one-half.

  Matlab – discrete time simulation

MATLAB – Discrete time simulation, solve  Discrete time syetm problem,  DT kalman filter problem,  Steady state DT kalman filter problem

  Estimate the numerical wave speed

Scheme and try a couple of values for α, one close to 1 and the other not. Convince yourself that a smaller Δt is not necessarily a better choice.

  Write a function that takes a list of integers

Using ML write a function that takes a list of integers as argument and returns a pair consisting of the sum of the even position and the sum of the odd positions of the list.

  Dimensional plot of the free surface charge

Include a qualitative dispersion curve sketch thatdemonstrates the operating point at which your Matlab plot applies.

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