I am having a dataset and trying to plot a 3-d plot between the independent and dependent variables.but, I am getting this error whenever I am trying to plot here is my code:

    temp1 = reshape(data(:,1),m,1);
    temp2 = reshape(data(:,2),m,1);
    temp3 = reshape(data(:,3),m,1);


  • $\begingroup$ Your question seems to be off-topic here. Also, it is not clear what you are trying to achieve. $\endgroup$
    – nicoguaro
    Commented Apr 21, 2020 at 17:12

1 Answer 1


Double-check the documentation of mesh. temp3 must be a matrix of size length(temp1) x length(temp2), otherwise it won't work. That is literally what the error message is telling you. :)

What are you trying to plot exactly? Maybe you wanted to use plot3 instead?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.