Extract a row of multiple files in loop
1 view (last 30 days)
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
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
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');
file_name = '2905_WI-DC_\';
file_end = B00001(i);
Mahdi on 2 Jun 2014
I didn't look through the whole code, but based on the error, try the following:
Basically, you've defined line (the first time) as a matrix (vector) with 688 values, but when you're telling it to line(i), you're telling the code to only fill one cell, but the right of the equal sign, line is defined as more than one value. I'm not sure what the definition of some of your variables (Signal, Fluctuation, etc...) and their size.