Info

This question is closed. Reopen it to edit or answer.

table型の変数の​中身にSparseF​ilterを使いたい​です!

2 views (last 30 days)
donna
donna on 23 Jul 2020
Closed: MATLAB Answer Bot on 20 Aug 2021
初心者です.失礼します...
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 Comments
donna
donna on 29 Jul 2020
今回もありがとうございます!
気付くのが遅くなってしまい,申し訳ありません...
for文のアドバイスありがとうございます!これからはひとつひとつやってみます!
例題にある(data.X)の中身が知りたいのですが,調べ方が分からずに悩んでいます...
何かアドバイスありますでしょうか...?
Kenta
Kenta on 30 Jul 2020
「ワークスペース」にある、dataというところをクリックしていけばどんどんその中身が見れると思いますがいかがでしょうか?

Answers (0)

This question is closed.

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!