nestedLoopMatLabTranslation

nestedLoopMatLabTranslation - for t = 1:3 if(t==1)...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
%% Explicitly A = [2 4 6; 2 4 6;2 4 6] %% Implicitly % allocate space for matrix that will be 3x3 numbers = zeros(3); % outer loop for rows for k = 1:3 % inner loop for cols
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for t = 1:3 if(t==1) numbers(k,t) = 2; elseif(t==2) numbers(k,t) = 4; else numbers(k,t) = 6; end end end disp(numbers)...
View Full Document

Ask a homework question - tutors are online