필터 지우기
필터 지우기

Keep getting 'not enough input argumets' error

조회 수: 1 (최근 30일)
Pavinder Cheema
Pavinder Cheema 2016년 11월 27일
댓글: Star Strider 2016년 11월 27일
function output = g_x(x)
%This function finds the values of g(x)
set1=find((x)<((-pi)/2))
output(set1)=-1
x1 =((x)>=((-pi/2)))
x2 =abs(x)<=((pi/2))
set2=find(and(x1,x2))
output(set2)=sin(set2)
set3=find(abs(x)>(pi/2))
output(set3)=1
end
x = input('enter increment of spacing...')
x = [(-pi):x:(pi)]
y=g_x
end
The top is the function and the bottom is the script i'm using to create a graph however when i enter in a inrement value it never works and pops up with said error

채택된 답변

Star Strider
Star Strider 2016년 11월 27일
Try this:
y=g_x(x);
  댓글 수: 2
Pavinder Cheema
Pavinder Cheema 2016년 11월 27일
thank you it worked
Star Strider
Star Strider 2016년 11월 27일
My pleasure.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by