Variable user inputs (ie test numbers) to be used in a function
1 回表示 (過去 30 日間)
古いコメントを表示
Hello,
I am trying to write a code to allow a user to enter multiple test numbers which will then be processed using a function that I have already written (euro).
The test numbers will be in the format CX 2013-05-30 XX (test facility code, date, test reference number).
What I would like to happen is the user enters a number of tests into command interface (or external UI) which is written into a matrix (so I can call each number in turn into the function). It would also be preferable that the number of user input are also recorded for the loops.
Anyone here have any advice?
Cheers
Matt
2 件のコメント
回答 (2 件)
Iain
2013 年 6 月 6 日
Don't use the command line unless you REALLY have to.
list = {};
more = true;
while more
string = input('enter your stuff');
if strcmpi(string,'some "end" code')
more = false;
else
... process and store string in the right fashion, and log it
end
end
I would suggest that you use excel instead. That way your user writes a spreadsheet logging stuff, and use "xlsread" in the way you want to get the data. Or read it from a text file.
0 件のコメント
David Sanchez
2013 年 6 月 6 日
nargin will do.
In your function, add conditions checking the number of input arguments (nargin).
doc nargin
will tell you what you need
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!