error message for wrong data loaded

조회 수: 1 (최근 30일)
Lenka Misenkova
Lenka Misenkova 2013년 5월 14일
Hi everybody,
In my GUI I´m loading data and storing them into variables X and y. The a value is entered by user.It looks like that:
[FILENAME,PATHNAME]=uigetfile('*.txt')
loaddata=load(FILENAME)
if (a==1)
X = loaddata(:,1)
y = loaddata(:,2)
end
if (a==2)
X = loaddata(:,1:2)
y = loaddata(:,3)
end
...
But I would like to add an error message in case that user load the wrong data set if he set the value a is equal for example to 1. Do you guys have any idea ? TY for help

답변 (1개)

Walter Roberson
Walter Roberson 2013년 5월 14일
See error() and warning() and warndlg() and disp() and fprintf()
  댓글 수: 7
Lenka Misenkova
Lenka Misenkova 2013년 5월 20일
Thank you ver much that works
Walter Roberson
Walter Roberson 2013년 5월 20일
If your difficulty is solved, please mark this Answer as Accepted.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by