Extract a row of multiple files in loop
Ältere Kommentare anzeigen
Hi, I would like to get a fixed row from my matrices and save it to one .mat file. for example, in this code, i have 10 different matrices, and would like to save a fixed row (at row 460)from column 1-688. and from the below code, when i put
'line(i) =line+Signal(pixel_line,:);',
it keeps saying
'In an assignment A(I) = B, the number of elements in B and I must be the same.
Error in signal_fluctuation (line 36) line(i) =line+Signal(pixel_line,:);'
please help me. i have no idea how can i do this. BElow is the full code.
clear all close all
addpath 'C:\Program Files\MATLAB\R2012b\toolbox\readimx';
n_i =10; %Number of files
pixel_line = 460;
pixel_line2 = 462;%Pixel line to extract from bottom
Aver_Ray=zeros(520,688);
line=zeros(1,688);
line2=zeros(1,688);
B = readimx('2905_WI-DC\B00001_avg.IM7');
IB = (B.Data);
C = readimx('2905_He-DC\B00001_avg.IM7');
IC = (C.Data);
A = readimx('2905_WI-DC_\B00005.IM7');
IA= single(A.Data);
for i=1:n_i
%Reading file
file_name = '2905_WI-DC_\';
file_end = B00001(i);
A=readimx(strcat(file_name,file_end,'.IM7'));
IA= single(A.Data);
Signal=(IB-IC)'./(IA-IC)';
Fluctuation=std2(Signal);
result(i)=Fluctuation;
line(i) =line+Signal(pixel_line,:);
end
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!