필터 지우기
필터 지우기

function parameter - char

조회 수: 4 (최근 30일)
Ashraf
Ashraf 2012년 5월 12일
Hi everybody,
I wrote a function that get 4 parameters (one of them char = file name, and the other is arraies) and should open a file that his name was given, and some manipulations. function call looks like this
Amplitude_lie_det(file_name,qu_num,time_arr,answer_arr)
and I got an error :
??? Undefined function or method 'Amplitude_lie_det' for input arguments of type 'char'.
I will be very glad if someone that "meet" this error before can give me an advise...
thanks, Ashraf

답변 (3개)

Guo
Guo 2012년 5월 12일
You may check the type of your first parameter in the function,the error means you call your function with a mismatch parameter type(the first one)!

Oleg Komarov
Oleg Komarov 2012년 5월 12일
Check that the function is on the MATLAB path with:
which -all Amplitude_lie_det
If it says 'Amplitude_lie_det' not found, then add the path where the function is located to the MATLAB path:
addpath 'c:\yourpath'
or File > Set path > Add folder.
  댓글 수: 1
Walter Roberson
Walter Roberson 2012년 5월 12일
And make sure the routine is stored in a file named Amplitude_lie_det.m

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


Ashraf
Ashraf 2012년 5월 12일
thank you very much, I checked the file and his located, and after number of attempts I found that the function name and the file.m name not identical... I changed the name of the file and it's work :-)
Now I have another question, if I have a file that contain a samplings for some signals, and its arranged in matrix (not one dimensional vector), and I want to transform this data by STFT, I found some algorithems that do the transformation, but for vector (one dim.), but not for matrix... if someone used this transformation before, it will be very useful to me...
Thanks, Ashraf
  댓글 수: 1
Oleg Komarov
Oleg Komarov 2012년 5월 12일
Your initial issue is solved: if you think that my or Guo's suggestion helped you solve it, then accept one of the answers.
Then,since you're asking another question I suggest to post a new thread. You will get more attention from a wider pool of contributors and the chances to get an answer will not be tied to those that participated to this thread only.

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

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by