Need matlab Answers with proper comments, Please. Thanks A 2D multiplication tab
ID: 3749020 • Letter: N
Question
Need matlab Answers with proper comments, Please. Thanks
A 2D multiplication table for 10*10
% using two dimensional array (Numerical)
for left = 1:10
for top=1:10
mult_table(left,top)=left*top;
end
end
Create two multi-dimensional arrays where the amay values corespond to the multiplication of the indices: .Create an 8 x 8 x 8 numerical array (3-D) and Create a 5x5x5x5 numerical array (4-D) These armays are similar to the multiplication table in Lecture 4 (slide 13), but are 3-D & 4-D instead of 2-D. Make sure that you use piece-wise multiplication, and not matrix multiplication. Fill the values in the matrices using Triple- and Quadruple nested for loops. Once you have filled the arrays, demonstrate how you would display only page 7 of the 3D array to the screen. Also show all values that occur in the 4D matrix at the locations row-3 and column-4 of each page.Explanation / Answer
a)
%A 3D multiplication table for 5*5*5
% using THREE dimensional array (Numerical)
for right=1:5
for left = 1:5
for top=1:5
mult_table(right,left,top)=right*left*top;
end
end
end
mult_table
b)
%A 4D multiplication table for 8*8*8*8
% using Four dimensional array (Numerical)
for left=1:8
for right=1:8
for top = 1:8
for bottom=1:8
mult_table(left,right,top,bottom)=left*right*top*bottom;
end
end
end
end
mult_table
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.