フィルターのクリア

Covert Matlab Code to C language

1 回表示 (過去 30 日間)
Rohan  Mehta
Rohan Mehta 2019 年 6 月 29 日
コメント済み: Sameer Gadekar 2019 年 6 月 29 日
Hello There, I have made an matlab code and I want to covert the given code to C, I am using the inbuilt app to convert the code but facing some problems Can anyone help ?
The relevent documents are attached.
  2 件のコメント
Sameer Gadekar
Sameer Gadekar 2019 年 6 月 29 日
Code generation does not support variable 'X' growth through indexing. where in your code X is k max1 and q.
k(j+1) = i;
max1(n)=max(mat1(:));
q(t) = find(A == max1(t),1,'first');
This is limitation of the coder.
Please find the solution on the below link
Sameer Gadekar
Sameer Gadekar 2019 年 6 月 29 日
function G = Bioscan(W) %#codegen
W = load('C:\Users\ROHAN\Desktop\C4.csv');
A = W(:,2);
C = find(A<75);
k = [];
max1 = [];
q = [];
A(C) = 0;
i = 1;
j = 0;
n = 1;
t = 1;
k = 0;
max1 = 0;
q = 0;
while i<1000004
while A(i)>75
k = [k i];
i = i+200000;
j = j+1;
if j == n
mat1=A((k(n)-25):(k(n)+30));
max1 = [max1 max(mat1(:))];
n = n+1;
end
if (i - 200000) ~= k(j)
A(i-200000) = 0;
end
if j == 5
break
end
if i > 1000004
r = 1;
V = fprintf('Invalid Data \n');
return
end
end
if j == 5
while t<=5
q = [q find(A == max1(t),1,'first')];
t = t+1;
end
idx = setdiff(1:length(A),q); % indexes which are not in q
A(idx) = 0;
plot(A);
title('Recieved Signal');
xlabel('Samples');
ylabel('Amplitute (In mV)');
return;
end
if (j <= 4 && j >= 1)
i = k(1)+1;
j = 0;
o = 1;
n = 1;
end
i = i+1;
end
end

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangePulsed Waveforms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by