For loop not starting at 1

11 ビュー (過去 30 日間)
Robert Roy
Robert Roy 2016 年 9 月 4 日
回答済み: Thorsten 2016 年 9 月 5 日
Hi guys, I am trying to run a loop of an image which finds the max value and then used that value Max1 to then get a normalised signal however if l1 doesnt start at 1, the normalisation doesnt work and a much larger value occurs in the very first number of l
if true
figure(p+3);
l1=7
l2=17
for l=l1:l2
Cr1=[1 (VerticalBurnerStart+(l*(y2/Res))) x-1 y2/Res];
Cr = imcrop(YourData, Cr1);
T{l}=mean(Cr).'; % Find the mean of each column in array
K3= plot(x2,T{l},'DisplayName',['HAB= ' num2str(l)]);
Max(l)=(max(unique(T{l})));
hold on
end
legend(gca,'show');
Max1=max(Max);
end

採用された回答

Thorsten
Thorsten 2016 年 9 月 5 日
If you set Max(7) = something, values Max(1) til Max(6) are set to zero if Max does not exists, or it keeps the values in Max(1) til Max(6) from previous runs.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by