Home how to change size(out) = [m n] in matlab

# how to change size(out) = [m n] in matlab

nobel
1#
nobel Published in 2015-02-21 20:44:27Z
 This is a continuation of my previous problem, so now i want to know how to change array size and how to use size(out) = [m n]. so basically if you have 10x10 array and you want to plot column 9 vs. column 10 in scatter plot, and you want column 1-column 8 to be the labels of your scatter plot. how can i use size(out) = [10 10]? for someone who want examples: Auto-Label in scatter plot using matlab and what if your array is m x n? is there a general code for this? please enlighten me, thanks.
Benoit_11
2#
 To make things more general you can make use of the end keyword, which refers to the last row/column or an array/cell array/anything in Matlab (actually "last array of index"). Revisiting your example, you could use num2str (alternatively to sprintf) and use the following: scatter(out(:,end-1), out(:,end)); for k = 1:size(out,1) T{k} = num2str(out(k,1:end-2)); end xshift = 0.03; yshift = 0.03; text(out(:,3)+xshift, out(:,4)+yshift, T); grid on  Which gives this: