MATLAB: Horzcat error when trying to display an entire column from a 4 by 4 matrix

beginnererrorhorzcatMATLABmatrix

clear all
m=input ('please input a 4 by matrix');
w=input (' do you want to display a row, column or a single element of the matrix?, for a row type 1, for a element type 2 and for column type 3');
if w==1
dumb=input ('what row do you want displayed?');
if dumb==1
disp (['your chosen row is ' num2str(m(1,:))])
elseif dumb==2;
disp (['your chosen row is ' num2str(m(2,:))])
elseif dumb==3;
disp (['your chosen row is ' num2str(m(3,:))])
elseif dumb==4
disp (['your chosen row is' num2str(m(4,:))])
end;
elseif w==3
stupid=input ('what column do you want displayed?');
if stupid==1 %for some reason this doesnt really work :S
disp (['your chosen column is ' num2str(m(:,1))])
elseif stupid==2;
disp (['your chosen column is ' num2str(m(:,2))])
elseif stupid==3;
disp (['your chosen column is ' num2str(m(:,3))])
elseif stupid==4;
disp (['your chosen column is ' num2str(m(:,4))])
end;
elseif w==2
re=input ('what row do you want selected ');
rc=input ('what column do you want selected ');
disp ([' Your chosen value based on your rows and columns is ' num2str(m(re,rc))])
end;

Best Answer

num2str() applied to a column vector results in a character array with as many rows of output as there were rows in the column. You try to concatenate the single-row string 'your chosen column is ' with those multiple rows.
Try, e.g., num2str(m(:,3).')