Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
table型の変数の中身にSparseFilterを使いたいです!
조회 수: 1 (최근 30일)
이전 댓글 표시
初心者です.失礼します...
table型変数Tの中身に関して,SparseFilterをかけたいです.
以下のコードを作成しました.
for r=1:256
tr = T{r,1}{1};
rng default % For reproducibility
q = 100;
Mdl = sparsefilt(tr,q,'IterationLimit',20);
wts = Mdl.TransformWeights;
W = reshape(wts,[11,11,3,q]);
[dx,dy,~,~] = size(W);
for f = 1:q
Wvec = W(:,:,:,f);
Wvec = Wvec(:);
Wvec =(Wvec - min(Wvec))/(max(Wvec) - min(Wvec));
W(:,:,:,f) = reshape(Wvec,dx,dy,3);
end
m = ceil(sqrt(q));
n = m;
img = zeros(m*dx,n*dy,3);
f = 1;
for i = 1:m
for j = 1:n
if (f <= q)
img((i-1)*dx+1:i*dx,(j-1)*dy+1:j*dy,:) = W(:,:,:,f);
f = f+1;
end
end
end
imshow(img,'InitialMagnification',300);
end
このコードでのエラーの内容がこちらです
また,table型変数Tも添付いたします.
댓글 수: 3
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!