필터 지우기
필터 지우기

Error- simple matlab function

조회 수: 1 (최근 30일)
Shalini
Shalini 2012년 3월 6일
I have the following function;
function [epsilon,sigma] = concatenatingAllDataSets(total_sets,X,Y)
epsilon = reshape(X,total_sets,[]);
sigma = reshape(Y,total_sets,[]);
I'm kind of very new to matlab but not to programming of course.
I get the following error;
??? Input argument "X" is undefined.
Error in ==> concatenatingAllDataSets at 3
epsilon = reshape(X,total_sets,[]);
??? Input argument "X" is undefined.
Error in ==> concatenatingAllDataSets at 3
epsilon = reshape(X,total_sets,[]);
??? Input argument "X" is undefined.
Error in ==> concatenatingAllDataSets at 3
epsilon = reshape(X,total_sets,[]);
I know I need to define the argumants.Can someone help?

채택된 답변

Thomas
Thomas 2012년 3월 6일
Try the following:
X=[1:10];
Y=[11:20];
[a,b]=concatenatingAllDataSets(5,X,Y)
You need to define the arguments for X,Y and total sets either earlier or as inputs to the function..
THe output is:
a =
1.00 6.00
2.00 7.00
3.00 8.00
4.00 9.00
5.00 10.00
b =
11.00 16.00
12.00 17.00
13.00 18.00
14.00 19.00
15.00 20.00

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by