Your code runs for me without error in R2017b.
One possibility is that since ‘x’ is a row vector and ‘u’ is a column vector, transposing ‘x’ to a column vector could solve your problem:
plot(x', u, 'k')
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!