How to request an input
Show older comments
If I want the user to type in a 3x3 matrix of his/her choice before the program, what command will I use?
Accepted Answer
More Answers (1)
Image Analyst
on 18 Dec 2011
Or you can get fancy and use a table like the example in the help:
f = figure('Position',[200 200 400 150]);
fprintf('Here is what we are loading into the table:\n');
dat = rand(3)
cnames = {'X-Data','Y-Data','Z-Data'};
rnames = {'First','Second','Third'};
hTable = uitable('Parent',f,'Data',dat,'ColumnName',cnames,...
'RowName',rnames,'Position',[20 20 360 100]);
% Get data back out
data = get(hTable, 'Data')
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!