フィルターのクリア

I want to perform SVD on cell matrix. how to apply svd on bunch of matrix? or i have to apply svd on all single matrix? but I have so many matrix of different sizes. i have used cell function for that. now for apply svd please help me.

2 ビュー (過去 30 日間)
  • here is my code:
  • Tw = 40 ; Ts = 20; alpha = 0.97; M = 20; C = 6; L = 22; LF = 300; HF = 3700;
  • filelist1=dir('*.wav');
  • n=size(filelist1);
  • P=cell(n);
  • for k1=1:n
  • filename1=filelist1(k1).name;
  • [l1,fs1]=wavread(filename1);
  • l1 = l1(:,1);
  • P{k1} = ...
  • mfcc( l1, fs1, Tw, Ts, alpha, @hamming, [LF HF], M, C+1, L );
  • %[u s v]=svd(p); %[u s v]= svd(p(1))
  • end

採用された回答

Jan
Jan 2017 年 2 月 23 日
編集済み: Jan 2017 年 2 月 24 日
Use numel instead of size, because the latter replies a vector and for k1=1:size(x) might not do what you expect.
n = numel(filelist1);
P = cell(1, n); % cell(n) is a cell(n, n)
for k1 = 1:n
...
Here you process the files in a loop already. Calculating the SVD in addition should be easy:
S = cell(1, n);
V = cell(1, n);
D = cell(1, n);
for k1 = 1:n
...
if all(isfinite(P{k1}(:)))
[S{k1}, V{k1}, D{k1}] = svd(P{k1});
else
??? What ever you want.
end
end
  3 件のコメント
Pooja Patel
Pooja Patel 2017 年 2 月 24 日
Hey Jan Simon, Thank you so much for your help. code is running properly. I had 15 files total and loop was stopping at 7th file. actually the problem was in 8th sound file. so i deleted that file and now your given code is running.
Jan
Jan 2017 年 2 月 24 日
@Pooja: It depends on what you want the result to be. And SVD is not defined mathematically, if the input contains NaNs or Infs. What do you want as output in these cases? See [EDITED]

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEigenvalues についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by