Info
この質問は閉じられています。 編集または回答するには再度開いてください。
I have written a code to implement a poincare index technique in matlab.Now that,I have to convert the code into C ..Please help me out..Here is the code:
1 回表示 (過去 30 日間)
古いコメントを表示
function [PC,AR] = poincare_index_v1(theeta)
[rows cols] = size(theeta);
Np = 24;
PC = zeros(rows, cols);
AR = zeros(rows, cols);
for i = 4 : rows-4
for j = 4 : cols-4
bx = [i-3 i-3 i-3 i-3 i-3 i-3 i-3 i-2 i-1 i i+1 i+2 i+3 i+3 i+3 i+3 i+3 i+3 i+3 i+2 i+1 i i-1 i-2 i-3];
by = [j-3 j-2 j-1 j j+1 j+2 j+3 j+3 j+3 j+3 j+3 j+3 j+3 j+2 j+1 j j-1 j-2 j-3 j-3 j-3 j-3 j-3 j-3 j-3];
delta = 0;
for k = 0 : Np-1
indx = mod((k+1),Np)+1;
partial_del = theeta(bx(indx),by(indx)) - theeta(bx(k+1),by(k+1));
if(partial_del < (pi/2))
del = partial_del;
elseif (partial_del <= (-pi/2))
del = pi + partial_del;
else
del = pi - partial_del;
end
delta = delta + del;
end
PC(i,j) = delta / (2*pi);
% if(PC(i,j)==(3.533949646070574e-17))
% AR(i,j)=1;
% end
if(PC(i,j)>=0.45 && PC(i,j)<=0.55)
AR(i,j)=1;
end
if(PC(i,j)<=-0.45 && PC(i,j)>=-0.55)
AR(i,j)=2;
end
end
end
end
2 件のコメント
GOPEE Ajit Kumar
2016 年 6 月 28 日
Hello if you explain to me the code and/or algorithm may be I can help you to convert into C
Guillaume
2016 年 6 月 28 日
Unless this question is about using matlab coder (for which I can't help), this is not appropriate for this forum.
This is a matlab forum not a C forum.
Furthermore, if you can't convert that basic code (in that it is simply loops and indexing with no high-level functions used) into C on your own, perhaps learning the basics of C is in order?
回答 (1 件)
GOPEE Ajit Kumar
2016 年 6 月 28 日
Hello if you explain to me the code and/or algorithm may be I can help you to convert into C
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!