Clear Filters
Clear Filters

line of code help!

4 views (last 30 days)
HUH
HUH on 3 Dec 2013
Answered: dpb on 3 Dec 2013
I was wondering if someone could help me diagnose what the 3rd to last line of code - y{jj,ii}(:,(ii+1):end) = x{jj}(:,(ii+1):end); -- does for this block.
for jj = 1:N
y{jj,1} = ones(N+1);
y{jj,1}(:,2:end) = x{jj}(:,2:end);
A(jj,1) = det(y{jj,1});
y{jj,ii} = ones(N+1);
y{jj,ii}(:,1:(ii-1)) = x{jj}(:,1:(ii-1));
y{jj,ii}(:,(ii+1):end) = x{jj}(:,(ii+1):end);
A(jj,ii) = det(y{jj,ii});
end

Answers (1)

dpb
dpb on 3 Dec 2013
for jj = 1:N
...
y{jj,ii}(:,1:(ii-1)) = x{jj}(:,1:(ii-1));
y{jj,ii}(:,(ii+1):end) = x{jj}(:,(ii+1):end);
...
end
Just loading the columns of the array from (ii+1)th to the last similarly as does the preceding line load from the first column to the (ii-1)th. The two lines together load all columns excepting for ii.
doc end
if it's that that's confusing -- it's a builtin that's position-sensitive as to what it returns, specifically.

Categories

Find more on Schedule Model Components in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!