0

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);
    mesh(temp1,temp2,temp3);
    hold

thanks!

1 Answers1

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?

Federico Poloni
  • 11,344
  • 1
  • 31
  • 59