Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用其他矩阵中的列值替换matlab矩阵中的值_Matlab_Matrix - Fatal编程技术网

使用其他矩阵中的列值替换matlab矩阵中的值

使用其他矩阵中的列值替换matlab矩阵中的值,matlab,matrix,Matlab,Matrix,我有一个大矩阵(8656x25960),里面有一些斑点噪声。我使用findpeaks工具来查找哪些列中的峰值确实高于某个阈值。findspeaks工具的输出是一个包含所有坏列的矩阵,例如- loc = Columns 1 through 6 30 51 155 307 333 338 Columns 7 through 12 642 955

我有一个大矩阵(8656x25960),里面有一些斑点噪声。我使用
findpeaks
工具来查找哪些列中的峰值确实高于某个阈值。
findspeaks
工具的输出是一个包含所有坏列的矩阵,例如-

loc =

  Columns 1 through 6

          30          51         155         307         333         338

  Columns 7 through 12

         642         955        1409        1567        1728        1730

  Columns 13 through 18

        2332        2546        2615        2685        2806        2995

  Columns 19 through 24

        3002        3122        3124        3164        3690        4176

  Columns 25 through 30

        4430        4475        4539        5142        5155        5244

  Columns 31 through 36

        5246        5941        5943        6114        6486        6922

  Columns 37 through 42

        7165        7169        7460        7587        7647        8944

  Columns 43 through 44

       12754       13693
如何将这些列的编号与原始矩阵一起使用,并将此“坏”列的值替换为值0(例如)。
希望我足够清楚。

对于行向量
Ioc
只需使用索引:

yourmatrix(:,Ioc) = 0;