Input argument in function undefined

조회 수: 9 (최근 30일)
Utkarsh Singh
Utkarsh Singh 2014년 11월 1일
댓글: Image Analyst 2014년 11월 1일
Whenever I run this code I get this error. The code is attached. The error is:
??? Input argument "sym" is undefined.
Error in ==> ARM_deco at 10 if(length(sym)==length(p) && sum(p)==1)
  댓글 수: 2
Azzi Abdelmalek
Azzi Abdelmalek 2014년 11월 1일
Post the entire code
Utkarsh Singh
Utkarsh Singh 2014년 11월 1일
Azzi, just attached the code.

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

답변 (1개)

Image Analyst
Image Analyst 2014년 11월 1일
how did you call Arithmetic_dec(sym,p,tagword)? Did you just click on the green triangle, which doesn't supply any input arguments (I think this was most likely what you did), or did you give a bad value for sym, like
Arithmetic_dec([],1,'bombs')
  댓글 수: 5
Utkarsh Singh
Utkarsh Singh 2014년 11월 1일
Image Analyst-I just modified the first line of the code to
function[]=Arithmetic_dec(sym,p,tagword,varargin)
but it still shows the same error. Kindly tell me what exactly I must do.Thanks
Image Analyst
Image Analyst 2014년 11월 1일
Why don't you make a tests script to assign input variables and call this function? If you just want to click the green triangle, then don't have any arguments at all and just assign them inside the function. Or get rid of the function line and turn it into a simple script.

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

Community Treasure Hunt

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

Start Hunting!

Translated by