- #1
mesa
Gold Member
- 695
- 38
Homework Statement
A = [1 3; 2 4]; %Okay, so we are starting with this matrix
N = 2; %Here we are setting N equal to '2'
for k = 1:N %So here we have a 'for loop' for variable 'k' starting at 1 in increments of '1' up to 'N', which
%happens to be '2' so once this function gets to '2' it stops
X(k) = 0; %Sets some 'function X' with variable 'k' equal to '0'
end
%Our loop ends with X(1)=0 and X(2)=0
for k = 1:N %Start of a new loop, same as before.
for m = 1:N %Another loop written in our other loop.
X(k) = X(k) + abs(A(m, k)); %Here we are taking our X(k) from earlier? and now adding the absolute value of
%our matrix A as a function of m and k?
end
end
F = X(N);
for k = 1:N-1
if X(k) > F
F = X(k);
end
end
I am having trouble understanding what this code is supposed to do. The comments are my attempt at trying to understand it and as you can see I am getting lost at the second loop and the 'abs' command (possibly messing up earlier).