The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 4 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
**Write a MATLAB
function C=matshuffle(A,B)
whose arguments are two matrices A and B.
If the two matrices are not of the same size, the function breaks with an error message; otherwise, an output matrix C is formed in the way that its odd numbered columns are the ordered columns of A and its even numbered columns are the ordered columns of B.
Important Note: the output matrix C must have twice as many columns as A (or B).
The function could use a single for loop to construct matrix C.
**Type the function matshuffle in your diary file and determine the output matrices C by running the function matshuffle(A,B) on each of the sets of matrices:
(a) A=magic(6)
B=eye(6)
(b) A=ones(6)
B=eye(5)
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll