??? Undefined function or method 'hw1_p2_x_vs_k' for input arguments of type 'double'. "
Show older comments
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
More Answers (1)
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 Software Development in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!