Can anyone tell me why this while loop doesn't give me what I want? I want to get simple values such that starting from 0.001 to 0.01 with increment 0.001,0.01 to 0.1 with increment of 0.01,0.1 to 1 with increment 0.1, and 1 to 10 with increment 1. Second question of mine, when I have vsl ==0.1, why it doesn't go into the if loop? What am doing wrong? Thank you!
%% Calculate the gas fraction vsl = 0.001; vsl1 = vsl; vslSave = [];
while vsl<=10
if vsl >=0.001 && vsl<=0.01 increment = 0.001; elseif vsl >=0.01 && vsl< 0.1 increment = 0.01; elseif vsl >=0.1 && vsl<=1.0 increment = 0.1; else increment = 1; end if (vsl==0.1) increment = 0.1; end vsl = vsl + increment; vslSave = [vslSave;vsl];endvslSave = [vsl1;vslSave];
Best Answer