Too many output arguments
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
hi, i newbie to matlab i am creating a very simple feed forward network, but i keep getting the too many output arguments error. what can i do?

채택된 답변
Star Strider
2020년 12월 28일
0 개 추천
Without knowing what ‘dataset’ is, although assuming that it is an array with 2 columns, try this:
Input = dataset(:,1);
Target = dataset(:,2);
댓글 수: 10
Ditf
2020년 12월 28일
ah what if it has 11 columns and the first 10 are the input and the last colomn is the output
Star Strider
2020년 12월 28일
In that case:
Input = dataset(:,1:10);
Output = dataset(:,11);
or equivalently:
Input = dataset(:,1:end-1);
Output = dataset(:,end);
.
Ditf
2020년 12월 28일
i have done what you suggested but i still get 'input and target have different number of samples', can you help?

Image Analyst
2020년 12월 28일
Well this is a different dataset than the first time you asked. Please attach the breastcancer.mat file.
In the meantime, input has 10 columns while target has 1 columns. It says they need the same number of samples. Can you take just one of the columns of input
inputColumn = breastcancer(:, 1); % Take column 1.
Do NOT use input as the name of your variable since that is a built-in function that you do not want to blow away.
Ditf
2020년 12월 28일
the dataset i am using is https://archive.ics.uci.edu/ml/datasets/breast+cancer+wisconsin+(original)
it needs all 10 attributes as inputs to make that one output
what can i do?
Star Strider
2020년 12월 29일
Assuming you need to use ‘breast-cancer-wisconsin.data’, the way I chose to import it is:
opts = detectImportOptions('breast-cancer-wisconsin.data', 'FileType','text');
BCTable = readtable('breast-cancer-wisconsin.data', opts);
InputVariables = BCTable(:,1:10);
OutputVariable = BCTable(:,11);
and that appears to work.
Examing the imported file with:
FirstFiveRows = BCTable(1:5,:)
produces:
FirstFiveRows =
5×11 table
Var1 Var2 Var3 Var4 Var5 Var6 Var7 Var8 Var9 Var10 Var11
_______ ____ ____ ____ ____ ____ ____ ____ ____ _____ _____
1000025 5 1 1 1 2 1 3 1 1 2
1002945 5 4 4 5 7 10 3 2 1 2
1015425 3 1 1 1 2 2 3 1 1 2
1016277 6 8 8 1 3 4 3 7 1 2
1017023 4 1 1 3 2 1 3 1 1 2
.
Ditf
2020년 12월 29일
yes it work but when i try to configure the network i get the error that the input data is not a matrix or cell array.
Star Strider
2020년 12월 29일
Try this to create a matrix from them:
InputVariables = table2array(BCTable(:,1:10));
OutputVariable = table2array(BCTable(:,11));
See the documentation on table2array for details on the function. You can also use table2cell, linked to in the table2array documentation, if you want them as a cell array instead.
Ditf
2020년 12월 29일
Thank you so much for your help, i greatly appreciate it.
Star Strider
2020년 12월 29일
As always, my pleasure!
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
