problem with error message when wrong data are loaded
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
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. For example when the user set value a(to be equal to 2) that means that his data are supposed to have 2 dependendent variable and one independent variable. It means that his data have 3 columns. So imagine that he sat that he have 2 independent variables but he mistankely load data which have for example 4 or 5 columns or more. Do you guys have any idea how can I fix it ?
1 件のコメント
Walter Roberson
2013 年 5 月 19 日
回答 (0 件)
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!