# MATLAB: Nernst Equation plotting in MATLAB

MATLABmatrixplotting

I am unable to plot an Eout1 vs pH graph for changing quantities of Temperature and pH values.The code is:
``%Constant Temperature and Changing pHpH = 0:14;%pH ValueT = 300;% Temperature value in KelvinR = 8.3145;% Gas Constantn = 1;% Number of molesF = 96485;% Faradays ConstantE0 = 30e-3% Standard Cell PotentialEout = -(E0 - (R*T/n*F)*pH)/1.0e+09 %Modified Nernst Equationplot(pH,Eout)%plot firts graph%Changing pH and Changing TemperatureT1 = 294:307;%Temperature RangeEout1 = -(E0 - ((T1*R)/n*F)*pH)/1.0e+09hold onplot(pH,Eout1)``
The first Eout vs pH graphplots fine. However, the Eout1 vs pH graph displays the error message:
``Error using  * Inner matrix dimensions must agree.``
I did try using "." operator in some combinations still no resolve.
Any ideas on solving this?

``%Constant Temperature and Changing pHpH = 0:14;%pH ValueT = 300;% Temperature value in KelvinR = 8.3145;% Gas Constantn = 1;% Number of molesF = 96485;% Faradays ConstantE0 = 30e-3% Standard Cell PotentialEout = -(E0 - (R*T/n*F)*pH)/1.0e+09 %Modified Nernst Equationplot(pH,Eout)%plot firts graph%Changing pH and Changing TemperatureT1 = 294:308;%Temperature Range % <===== changed range hereEout1 = -(E0 - ((T1.*R)./n*F).*pH)/1.0e+09 % <===== used element wise operators.hold onplot(pH,Eout1)``