フィルターのクリア

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 Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by