MG_22 (matrix manipulation using a for loop construct [duplicates MG-21]) My Solu Determine all elements in a matrix that are evenly divided by 5 (using a for loop construct to process each element)...


MG_22 (matrix manipulation using a for loop construct [duplicates MG-21])<br>My Solu<br>Determine all elements in a matrix that are evenly divided by 5 (using a for loop construct to process each element)<br>(NOTE: the solution script will produce same output as MG_21)<br>Given the input matrix A (10x10), write code that includes a for loop that will operate on each element in the matrix to determine if each element can be evenly divided by 5<br>When TRUE then square the element and write it to an array named B. Array B should dynamically increase to include all the selected elements (squared) that are divisable by<br>5. When all elements in the matrix have been evaluated the resultant array B should be sorted (in increasing value) into a ROW vector and should only have unique values (see<br>help on built-in function unique)<br>You solution can either reshape the matrox A into a ROW vector before the processing in the for loop OR B can be reshaped following the completion of the for loop<br>Script<br>A Save<br>C Reset<br>I MATLAB Documentation<br>A - magic (20):<br>Run Script<br>Assessment: 1 of 3 Tests Passed<br>O Does the solution use a loop construct? (assuming a for loop is used) (Pretest)<br>Run Pretest<br>Submit<br>O is the output array (B) correct?<br>Variable B must be of size (1 20L n is currently of size (131 Check where the variable is assigned a value<br>DELL<br>TCOTT<br>smile<br>Smite DiresIClu.com<br>Citut<br>ali-nekdad e hat<br>

Extracted text: MG_22 (matrix manipulation using a for loop construct [duplicates MG-21]) My Solu Determine all elements in a matrix that are evenly divided by 5 (using a for loop construct to process each element) (NOTE: the solution script will produce same output as MG_21) Given the input matrix A (10x10), write code that includes a for loop that will operate on each element in the matrix to determine if each element can be evenly divided by 5 When TRUE then square the element and write it to an array named B. Array B should dynamically increase to include all the selected elements (squared) that are divisable by 5. When all elements in the matrix have been evaluated the resultant array B should be sorted (in increasing value) into a ROW vector and should only have unique values (see help on built-in function unique) You solution can either reshape the matrox A into a ROW vector before the processing in the for loop OR B can be reshaped following the completion of the for loop Script A Save C Reset I MATLAB Documentation A - magic (20): Run Script Assessment: 1 of 3 Tests Passed O Does the solution use a loop construct? (assuming a for loop is used) (Pretest) Run Pretest Submit O is the output array (B) correct? Variable B must be of size (1 20L n is currently of size (131 Check where the variable is assigned a value DELL TCOTT smile Smite DiresIClu.com Citut ali-nekdad e hat

Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here