line of code help!

4 次查看(过去 30 天)
HUH
HUH 2013-12-3
回答: dpb 2013-12-3
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

回答(1 个)

dpb
dpb 2013-12-3
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.

类别

Help CenterFile Exchange 中查找有关 Schedule Model Components 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by