Is v constant? In that case, you don't need to call integral(). You can just use VDC=v*(int_sup-int_inf). However, you can fix the error in the current code by replacing the line with
VDC = (1/T*(integral(f,int_inf,int_sup, 'ArrayValued', 1)))
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!