Clear Filters
Clear Filters

??? Undefined function or method 'hw1_p2_x_vs_k' for input arguments of type 'double'. "

1 view (last 30 days)
k=[1:i-1];
r_db = log10(r) .* 10;
k_db = k .* 10;
hw1_p2_x_vs_k(k,p,'power [W]');
%hw1_p2_x_vs_k(k,r,'snr');
hw1_p2_x_vs_k(k,r_db,'snr [db]');
hw1_p2_x_vs_k(k,e,'error of SNR');
hw1_p2_x_vs_k(k,alpha,'alpha');
hw1_p2_x_vs_k(k,p,'power [W]');
hw1_p2_x_vs_k(k,alpha,'alpha');
I get this error when I try to run this in my program
"hw1_p2_x_vs_k(k,alpha,'alpha');
??? Undefined function or method 'hw1_p2_x_vs_k' for input arguments
of type 'double'. "

Accepted Answer

Walter Roberson
Walter Roberson on 10 Nov 2011
I do not see anything obvious, but please recheck all of your code lines to be sure that all of them use h w digit-for-one, and that none of them use h w lower-case-L

More Answers (1)

Wayne King
Wayne King on 10 Nov 2011
In addition to Walter's suggestion, also check that you have saved that function in a folder on the MATLAB path. If you enter
>>which hw1_p2_x_vs_k
You should get the path to that function returned. If you get 'hw1_p2_x_vs_k' not found, check your spelling carefully as Walter has suggested. If that is not the problem, make sure the folder (directory) that you have the functions in is listed when you enter
>>path
If not, use addpath (see the help) or pathtool
>>pathtool
to add the folder.

Categories

Find more on Search Path in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!