If you have symbolic toolbox, then try this
syms v(z) P EI
eq = EI*diff(v,4) == -P*z
v = dsolve(eq)
Result from live editor

Note that, I assumed in your question, d^4v/dz^4
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!