finding values from arrays - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

finding values from arrays

harley05harley05 Posts: 1Member
hi, trying to display some values but am not sure how to go about it. I want to do is; find Vb at half of Vb_ev and then find the corresponding pH value at that point. see last 2 lines. any help will be appreciated.

[code]Ka = 1.755388e-5;
Ca = 0.5;
Cb = 0.1;
Va = 100;
Vb = 0.1:0.1:1200;
Ma = (Ca * Va) / 1000;
Mb = (Cb .* Vb) ./ 1000;
for i = 1:length(Mb)
M_excess = Ma - Mb(i);
if abs(M_excess)<eps
Hplus = Ka * ((Ma_final * 0.999999) ./ Mb_final);
Vb_ev = Vb(i);
pH_ev = pH(end);
else
Ma_final = (M_excess * 1000) ./ (Va + Vb(i));
Mb_final = (Mb(i) * 1000) ./ (Va + Vb(i));
Hplus = Ka * (Ma_final ./ Mb_final);
end
pH(i) = -log10(Hplus);
end
%
Vb_Mid_Pt1 = find half of Vb_ev
pH_Mid_Pt1 = i want to find pH at Vb_Mid_Pt1;[/code]
Sign In or Register to comment.