How to graph different variables with different length in MATLAB?

Home / Uncategorized / How to graph different variables with different length in MATLAB?

Question:
I have 165545*1 double and 1*351 double variables. I want to put 165545 * 1 on y axis and 1*351 on x axis using plot(x,y) or scatter(x,y).


Answer:
You can select random x’ to build xi vector with same number of elements as y_idx=randi([1,length(x)],1,length(y));
xi=x(idx);
scatter(xi,y)
Read more

Leave a Reply

Your email address will not be published. Required fields are marked *