clear;clc;close all;
B(3,3) = 0;
for row = 1:3
for col = 1:3
if (mod(row+col,3)==0)
B(row,col) = 3;
elseif (mod(row+col,3)==1)
B(row,col) = 2;
elseif(mod(row+col,3)==2)
B(row,col) = 1;
end
end
end
mycolormap = [0 0 1;1 0 0; 1 1 0];
colormap(mycolormap)
imagesc(B)
axis square
% filling the empty template
template{3,3} = [];
colors = {'blue','red','yellow'}; %long names for RGB triplet in
mycolormap
for row = 1:3
for col = 1:3
if (mod(row+col,3)==0)
template{row,col} = {B(row,col),colors{B(row,col)}};
elseif (mod(row+col,3)==1)
template{row,col} = {B(row,col),colors{B(row,col)}};
elseif(mod(row+col,3)==2)
template{row,col} = {B(row,col),colors{B(row,col)}};
end
end
end
COMMENT DOWN FOR ANY QUERY RELATED TO THIS ANSWER,
IF YOU'RE SATISFIED, GIVE A THUMBS UP
For each of the following Matlab codes, fill in each cell of the empty template with TWO VALUES: ...
Exereise 5 (4 pts) The following MATLAB pattern detector scans image matrix A for TWO DIFFERENT PATTERN TYPES, as indicated by the form of the IF/ELSEIF construction. Each pattern's count is recorded separately, and stored either in the variable counterA or in the variable counterB. What are the final values stored in variables counterA and counterB when the follow ing MATLAB pattern detector program finishes execution? Circle each pattern type found in matrix A. Please use two different colors, one...
Please show all handwritten steps Exercise 4 (2 pts): When run, the following MATLAB code produces one of the four images shown below. Circle the image that is produced by the MATLAB code: (SHOW WORK!) clear:clc A (5, 5) 0 mycolormap= [10 0; 0: 011 colormap (mycolormap) for m 1:5 for n = 1:5 A (m, n) mod (m+n, 5) end end imagesc (A) axis square A) B) c) D)
For each of the below codes, determine if the following MATLAB codes produces an error. • If the code does NOT produce an error, predict the output. • If the code DOES produce an error: (1) state what line the FIRST error is found and what the error is ICE08B-1: clear;clc SICE08B-1 A = [1,5,2,9,4,9]; B(1,5) = 0; counter = 1; for i = 1:length(A) B(1) = A(i) * counter; B(1) = B(i)-2; counter = counter + 1; end ICE08B-2:...
matlab please Problem 1. PART A Create a cell array called ca that will contain the following: [Physics] [14][1 4 -3 8] [ITim] [Burnett]] [23] [Jessica] [Wul] [3 9 17] [Chemistry] [8 7 2 91 [Literature] [IJavier] [Lopez] [54] As shown above, the cell array ca should contain within the cells of each row: a department name (eg. Physics), integer code (e.g., 14), an array of integers (e.g., [1 4-3 8]), and two sub-cells containing a person's first and last...
For each of the below codes, determine if the following MATLAB codes produces an error. If the code does NOT produce an error, predict the output. If the code DOES produce an error: (1) state what line the FIRST error is found and (2) what the error is clear;clc %ICE08B-1 A = [1,5,2,9,4,9]; B(1,5) = 0; counter = 1; for i = 1:length(A) B(i) = A(i) * counter; B(i) = B(i)-2; counter = counter + 1; end
Do the following using Matlab: Let A be a matrix where each row corresponds to an article, and each column to how often a specific word appears in the article. Patterns among the articles and words can often be identified by analyzing the singular values and vectors of the singular value decomposition of A. (a) Use the Matlab svd function to find the singular values of the following . Note this problem does not ask you to print out the...
In Python, starting with the 8x8 board solution that will be appended here add the following functionality: 1) Add code to create a list, containing 8 lists, with each of the 8 lists containing 8 null strings as values. Call the list of lists board. code provided by prof: import turtle validMovesList=['A0','A2','A4','A6','B1','B3','B5','B7', 'C0','C2','C4','C6','D1','D3','D5','D7', 'E0','E2','E4','E6','F1','F3','F5','F7', 'G0','G2','G4','G6','H1','H3','H5','H7','quit'] def drawSquare(t,length,color): t.fillcolor(color) t.begin_fill() for num in range(4): t.forward(length) t.left(90) t.end_fill() def drawRow(t,length,color1,color2): for i in range(4): drawSquare(t,length,color1) t.forward(length) drawSquare(t,length,color2) t.forward(length) def drawCircleFilled(t,size,color): t.fillcolor(color) t.begin_fill()...
whats the answers How many total integers elements are in an array with 4 rows and 7 columns? 07 28 11 What is the resulting array contents, assuming that itemList is an array of size 4 having contents -55, -1, 0, 9? for (i = 0; i < 4; ++i) { itemsList[i] - i; -54,0, 1, 10 O 0, 1, 2, 3 O 1, 2, 3, 4 O-55,-1, 0,9 Given an integer array myVals of size N_SIZE (i.e. int[] myVals...
Need help starting from question 9. I have tried multiple codes but the program says it is incorrect. Case Problem 1 Data Files needed for this Case Problem: mi pricing_txt.html, mi_tables_txt.css, 2 CSS files, 3 PNG files, 1 TXT file, 1 TTF file, 1 WOFF file 0 Marlin Internet Luis Amador manages the website for Marlin Internet, an Internet service provider located in Crystal River, Florida. You have recently been hired to assist in the redesign of the company's website....
Question:Matrix Notation Interpreter (matrix elements to cell array of formatted character vectors) Matlab question Matrix Notation Interpreter (matrix elements to cell array of formatted character vectors) A system of linear algebraic equations can be writen in matrx notation by applying the definizion of matrix multiplication. For example, the linear system Can be writen as or where and x = 2 matrix input ror the variable A and a × T e function command dennes the output variable linearSystem Code has...