Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 240663

Submitted on 6 May 2013 by Yaroslav

Correct

22Size
Leading solution size is 14.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
NaOH=0; % mol
sodium_acetate = 0.1; % mol
acetic_acid = 0.1; % mol
pH = round(buffer(NaOH, sodium_acetate, acetic_acid)*10)/10
pH_correct = 4.7;
assert(isequal(pH,pH_correct))
pH =
    4.7000
2
Pass
 
%%
NaOH=0.025; % mol
sodium_acetate = 0.1; % mol
acetic_acid = 0.1; % mol
pH = round(buffer(NaOH, sodium_acetate, acetic_acid)*10)/10
pH_correct = 4.9;
assert(isequal(pH,pH_correct))
pH =
    4.9000
3
Pass
 
%%
NaOH=0.05; % mol
sodium_acetate = 0.1; % mol
acetic_acid = 0.1; % mol
pH = round(buffer(NaOH, sodium_acetate, acetic_acid)*10)/10
pH_correct = 5.2;
assert(isequal(pH,pH_correct))
pH =
    5.2000