I got error while executing this solution

tic
k = gpuArray(1:0.5:10);
a = gpuArray(1:0.5:5);
n1 = numel(k);
n2 = numel(a);
numpl = repmat(k, 1, n2)';
denpl = repmat([ones(n2,1), a.', zeros(n2,1)] ,n1, 1);
w=[.1,.5,.8,1,2,8,15,50,100];
P=freqcp(numpl,denpl,w);
plottmpl(w,w,P);
gpu_time=toc

댓글 수: 7

KSSV
KSSV 2017년 7월 24일
You have to mention the error....
nelson
nelson 2017년 7월 24일
Error using set While setting the 'YLim' property of 'Axes': Value must be a 1x2 vector of numeric type in which the second element is larger than the first and may be Inf
Error in plottmpl (line 50) set(a,'box','on','xgrid','on','ygrid','on',...
Error in Untitled22 (line 15) plottmpl(w,w,P);
KSSV
KSSV 2017년 7월 24일
The error you have specified has nothing to do with the code you have given..
nelson
nelson 2017년 7월 24일
thank u.... But when i am running the same code without GPU m getting the template. But when m converting in GPU m getting the above errors.
KSSV
KSSV 2017년 7월 24일
Okay Okay...you are getting error in this function: plottmpl(w,w,P) it is not a inbuilt function..show us this function.
Adam
Adam 2017년 7월 24일
Use the debugging 'Stop on errors' option from the Breakpoints menu, then you will see instantly what the problem is.

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

답변 (1개)

Walter Roberson
Walter Roberson 2017년 7월 25일

0 개 추천

That code was not designed to expect the possibility that the data was on the GPU.
Please see attached for a modified version that gather()'s the data it needs.
Note: execution of this code also requires the following functions from http://www.codeforge.com/article/216700
bndsdef.m freqcp.m qatan4.m qftdefs.m qsubset.m repltest.m
Grabbing the source is a minor nuisance if (like me) you do not have a codeforge account -- you cannot just copy and paste the source.

카테고리

도움말 센터File Exchange에서 GPU Computing에 대해 자세히 알아보기

제품

태그

질문:

2017년 7월 24일

답변:

2017년 7월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by