- openang_range
- Bead_SSC
- Bead_nm
Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Saving a loop array
2 ビュー (過去 30 日間)
古いコメントを表示
I'm trying to save a loop array, each output (BeadC & BeadS) produces a 9x1801 double - I would like to save each iteration so it is 9x1801, 18x1801 etc. Currently it is producing the correct sizes but they are just repeats of the same data. What do I need to edit?
lam =[405 488]; % Wavelength of scatter (nm)
n=length(lam);
for t=1:n
nx= length(openang_range); % number of angles to calculate collection for
ny= length(Bead_SSC(t,:))*length(lam(t)); % length of all beads being calculated
jj=t*ny;
kk=jj-(ny);
b=(zeros(size(Bead_nm)));
c=length(b(:));
BeadC = zeros(c,nx);
BeadS = zeros(c,nx);
for j=1:ny
for ii=j:kk:c
[BeadC(ii,:), BeadS(ii,:)] = Length1(Bead_nm(t, j), Bead_RI(t, j), lam(t), k0(t), n_wat(t), openang_range); % Collect or Create Predicted Data for Analysed Flow Cytometry Beads
end
end
end
4 件のコメント
Image Analyst
2016 年 12 月 18 日
Make it easy for us to help you, not hard. That means making it so that we can run your code. Please give us values for the missing variables so we can do that, like John already asked you for.
採用された回答
その他の回答 (1 件)
Jan
2016 年 12 月 17 日
編集済み: Jan
2016 年 12 月 17 日
The right hand side of the innermost loop does not depend on the loop counter ii:
Length1(Bead_nm(t, j), Bead_RI(t, j), lam(t), k0(t), n_wat(t), openang_range);
Therefore the results must be repeated. I cannot guess where the dependency to ii must be inserted.
Note: Use the more efficient c=numel(b) instead of c=length(b(:)).
2 件のコメント
Jan
2016 年 12 月 18 日
I have no idea. I cannot imaging, what the loops should do. I only see, what they do and that they do it repeatedly.
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!