Question

In: Computer Science

Using MatLab Transpose and reshape elcentro into a single-column vector named acc. elcentro = [0.00630000000000000   0.00364000000000000  ...

Using MatLab

Transpose and reshape elcentro into a single-column vector named acc.

elcentro = [0.00630000000000000   0.00364000000000000   0.000990000000000000   0.00428000000000000   0.00758000000000000   0.0108700000000000   0.00682000000000000   0.00277000000000000
-0.00128000000000000   0.00368000000000000   0.00864000000000000   0.0136000000000000   0.00727000000000000   0.000940000000000000   0.00420000000000000   0.00221000000000000
0.000210000000000000   0.00444000000000000   0.00867000000000000   0.0129000000000000   0.0171300000000000   -0.00343000000000000   -0.0240000000000000   -0.00992000000000000
0.00416000000000000   0.00528000000000000   0.0165300000000000   0.0277900000000000   0.0390400000000000   0.0244900000000000   0.00995000000000000   0.00961000000000000
0.00926000000000000   0.00892000000000000   -0.00486000000000000   -0.0186400000000000   -0.0324200000000000   -0.0336500000000000   -0.0572300000000000   -0.0453400000000000
-0.0334600000000000   -0.0320100000000000   -0.0305600000000000   -0.0291100000000000   -0.0276600000000000   -0.0411600000000000   -0.0546600000000000   -0.0681600000000000
-0.0816600000000000   -0.0684600000000000   -0.0552700000000000   -0.0420800000000000   -0.0425900000000000   -0.0431100000000000   -0.0242800000000000   -0.00545000000000000
0.0133800000000000   0.0322100000000000   0.0510400000000000   0.0698700000000000   0.0887000000000000   0.0452400000000000   0.00179000000000000   -0.0416700000000000
-0.0851300000000000   -0.128580000000000   -0.172040000000000   -0.129080000000000   -0.0861300000000000   -0.0890200000000000   -0.0919200000000000   -0.0948200000000000
-0.0932400000000000   -0.0916600000000000   -0.0947800000000000   -0.0978900000000000   -0.129020000000000   -0.0765200000000000   -0.0240100000000000   0.0284900000000000
0.0809900000000000   0.133500000000000   0.186000000000000   0.238500000000000   0.219930000000000   0.201350000000000   0.182770000000000   0.164200000000000
0.145620000000000   0.161430000000000   0.177250000000000   0.132150000000000   0.0870500000000000   0.0419600000000000   -0.00314000000000000   -0.0482400000000000
-0.0933400000000000   -0.138430000000000   -0.183530000000000   -0.228630000000000   -0.273720000000000   -0.318820000000000   -0.250240000000000   -0.181660000000000];

Solutions

Expert Solution

acc = transpose(elcentro)

The above statement will return the transpose of elcentro and also reshape it into a single-column vector named acc.

This is how it is in MATLAB console:

>> elcentro = [0.00630000000000000   0.00364000000000000   0.000990000000000000   0.00428000000000000   0.0075800000
0000000   0.0108700000000000   0.00682000000000000   0.00277000000000000 -0.00128000000000000   0.00368000000000000
0.00864000000000000   0.0136000000000000   0.00727000000000000   0.000940000000000000   0.00420000000000000   0.0022
1000000000000 0.000210000000000000   0.00444000000000000   0.00867000000000000   0.0129000000000000   0.017130000000
0000   -0.00343000000000000   -0.0240000000000000   -0.00992000000000000 0.00416000000000000   0.00528000000000000
 0.0165300000000000   0.0277900000000000   0.0390400000000000   0.0244900000000000   0.00995000000000000   0.0096100
0000000000 0.00926000000000000   0.00892000000000000   -0.00486000000000000   -0.0186400000000000   -0.0324200000000
000   -0.0336500000000000   -0.0572300000000000   -0.0453400000000000 -0.0334600000000000   -0.0320100000000000   -0
.0305600000000000   -0.0291100000000000   -0.0276600000000000   -0.0411600000000000   -0.0546600000000000   -0.06816
00000000000 -0.0816600000000000   -0.0684600000000000   -0.0552700000000000   -0.0420800000000000   -0.0425900000000
000   -0.0431100000000000   -0.0242800000000000   -0.00545000000000000 0.0133800000000000   0.0322100000000000   0.0
510400000000000   0.0698700000000000   0.0887000000000000   0.0452400000000000   0.00179000000000000   -0.0416700000
000000  0.0851300000000000   -0.128580000000000   -0.172040000000000   -0.129080000000000   -0.0861300000000000   -0
.0890200000000000   -0.0919200000000000   -0.0948200000000000 -0.0932400000000000   -0.0916600000000000   -0.0947800
000000000   -0.0978900000000000   -0.129020000000000   -0.0765200000000000   -0.0240100000000000   0.028490000000000
0 0.0809900000000000   0.133500000000000   0.186000000000000   0.238500000000000   0.219930000000000   0.20135000000
0000   0.182770000000000   0.164200000000000 0.145620000000000   0.161430000000000   0.177250000000000   0.132150000
000000   0.0870500000000000   0.0419600000000000   -0.00314000000000000   -0.0482400000000000 -0.0933400000000000
 0.138430000000000   -0.183530000000000   -0.228630000000000   -0.273720000000000   -0.318820000000000   -0.25024000
0000000   -0.181660000000000];
>> acc = transpose(elcentro)
acc =

   0.00630000
   0.00364000
   0.00099000
   0.00428000
   0.00758000
   0.01087000
   0.00682000
   0.00277000
  -0.00128000
   0.00368000
   0.00864000
   0.01360000
   0.00727000
   0.00094000
   0.00420000
   0.00221000
   0.00021000
   0.00444000
   0.00867000
   0.01290000
   0.01713000
  -0.00343000
  -0.02400000
  -0.00992000
   0.00416000
   0.00528000
   0.01653000
   0.02779000
   0.03904000
   0.02449000
   0.00995000
   0.00961000
   0.00926000
   0.00892000
  -0.00486000
  -0.01864000
  -0.03242000
  -0.03365000
  -0.05723000
  -0.04534000
  -0.03346000
  -0.03201000
  -0.03056000
  -0.02911000
  -0.02766000
  -0.04116000
  -0.05466000
  -0.06816000
  -0.08166000
  -0.06846000
  -0.05527000
  -0.04208000
  -0.04259000
  -0.04311000
  -0.02428000
  -0.00545000
   0.01338000
   0.03221000
   0.05104000
   0.06987000
   0.08870000
   0.04524000
   0.00179000
  -0.04167000
   0.08513000
  -0.12858000
  -0.17204000
  -0.12908000
  -0.08613000
  -0.08902000
  -0.09192000
  -0.09482000
  -0.09324000
  -0.09166000
  -0.09478000
  -0.09789000
  -0.12902000
  -0.07652000
  -0.02401000
   0.02849000
   0.08099000
   0.13350000
   0.18600000
   0.23850000
   0.21993000
   0.20135000
   0.18277000
   0.16420000
   0.14562000
   0.16143000
   0.17725000
   0.13215000
   0.08705000
   0.04196000
  -0.00314000
  -0.04824000
  -0.09334000
   0.13843000
  -0.18353000
  -0.22863000
  -0.27372000
  -0.31882000
  -0.25024000
  -0.18166000

>>

Related Solutions

MATLAB Given a 20x20 matrix named G and a 20x1 vector named H, multiply the elements...
MATLAB Given a 20x20 matrix named G and a 20x1 vector named H, multiply the elements in the 14th column of G by the values in H (element-by-element multiplication, not a multiplication table).
The following code must be written using matlab How to loop through a vector in matlab...
The following code must be written using matlab How to loop through a vector in matlab and assigning a value to every 4th entry. The vector could be of any length. Thanks
Write a  program in C++ using a vector to create the following output. Declare a vector named  numbers    -  Don’t...
Write a  program in C++ using a vector to create the following output. Declare a vector named  numbers    -  Don’t specify a size and don’t initialize with values. Starting with 2, pushing these into the back of the vector:   2, 4, 6, 8, 10 vector capacity (array size) changes and is dependent on the compiler. The size of the list is now 5. The vector capacity (array size) is 6. The back element is: 10 The front element is: 2 Now deleting the value at...
Write a MATLAB function named myaccel that accepts three inputs and has a single output. Inputs:...
Write a MATLAB function named myaccel that accepts three inputs and has a single output. Inputs: a list of time values a list of position values a single time value. Output: a single number which is obtained by numerically differentiating position with respect to time twice (forward difference method) and then interpolating the results based on the third input. Example: time=0:10; position=time.^3; myaccel(time,position,2.8) % should return 22.8
Create a single MatLab script named Problem3.m that, when run, does the following: -Defines a blank...
Create a single MatLab script named Problem3.m that, when run, does the following: -Defines a blank tic-tac-toe board: a 3-by-3 matrix called board, with blank spots represented by zeros. Echo the blank board to the command window. -Asks Player 1 for a row and a column, then puts a 1 in the given location. Echoes the new board. -Asks Player 2 for a row and a column, then puts a 2 in the given location. Echoes the new board. Please...
ACC 202   ACC Cycle set 2 This is to be prepared using pencil only on the...
ACC 202   ACC Cycle set 2 This is to be prepared using pencil only on the provided templates and lined or graph paper. P&S Plumbing began operations on 1/1/2017. Their annual reporting period ends 12/31. The trial balance on 1/1/2019 follows: Account title Debit Credit Cash 6,000 Accounts receivable 6,000 Allowance for uncollectable accounts 1,000 Supplies 13,000 Materials 7,000 Equipment 78,000 Accumulated Depreciation 8,000 Land Accounts payable Wages payable Interest payable Income taxes payable Long-term notes payable Common stock (8,000...
Matlab For a vector x=[1,10,-5,72,56,70,33] a) Use for loop to sum the vector x and count...
Matlab For a vector x=[1,10,-5,72,56,70,33] a) Use for loop to sum the vector x and count how many values are greater than 33. b) Repeat (a), this time a while loops.
a company uses a single -column sales journal(s), a single column purchases , a cash receipts...
a company uses a single -column sales journal(s), a single column purchases , a cash receipts journal , a cash payments journal and a general journal.indicate in which journal each of the fllowing tranbsaction would be recordede by placing the appropriate letter in the blank chegg Paid salarie, returned a purchase for credit , sold merchandise on credit ,recorded accrued salaries, sold merchandise for cash ,paid note due at bank purchases merchandise on credit, recorded closing entries , owner invested...
1. Using the alter table command, add a new column named gender making sure that only...
1. Using the alter table command, add a new column named gender making sure that only values of M, F or O are allowed. 2. Modify the data in the customers table to change the state for customers with ID number 2, 4, and 5 to NV. 3. Create a sequence that starts with -100 and increments by 10. Show the first value of the sequence. 4. Create a table named MYDATA with the following columns: id (primary key) and...
Use Matlab to introduce arow vector,f,and define it as a 1 by 4 vector showing values...
Use Matlab to introduce arow vector,f,and define it as a 1 by 4 vector showing values of 1, 2, 3and 4. Now try to build matrix D, using the following 2 commands a.D = [f ; A] b.D= [f , A] c.Which one can be built,and which one cannot be built? Explain your answer. Matrix A, which is a 4by 4 matrix, (The first, second, third and fourth column values are:2,4,6,8and 1,3,5,7 and 8,6,4,2 and 7,5,3,1 , respectively.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT