I am trying to implement matlab code in hdl using hdl coder.But iam getting errors like variable not initialized during fixed point conversion.How to resolve .Pls help
Show older comments
function [o]=fyp(a) load('100m'); a=val(1,:); subplot(3,2,1); plot(a); title('original ECG signal') b1=strel('disk',3); b2=strel('disk',4); b3=strel('disk',5); out1=imbothat(a,b1); out2=imtophat(a,b1); out3=imopen(a,b1); out4=imclose(a,b1); o1=(imsubtract(out1,out2))/2; o2=(imadd(out3,out4))/2; o=(imadd(o1,o2)); subplot(3,2,2); plot(o); title('After 1M filtering'); out11=imbothat(out1,b2); out21=imtophat(out2,b2); out31=imopen(out3,b2); out41=imclose(out4,b2); o11=(imsubtract(out11,out21))/2; o21=(imadd(out31,out41))/2; o1=(imadd(o11,o21))/2; % subplot(3,2,3); % plot((o1+(o/2))); % title('After 2M filtering'); out12=imbothat(out11,b3); out22=imtophat(out21,b3); out32=imopen(out31,b3); out42=imclose(out41,b3); o12=(imsubtract(out12,out22))/2; o22=(imadd(out32,out42))/2; o2=(imadd(o12,o22))/4; subplot(3,2,3); plot(o2+(o1/2)+(o/4)); y=o2+(o1/2)+(o/4); title('After 3M filtering'); m=0:3599; for m=2:length(y)-1 ys(m)=abs(y(m-1)+y(m)); end subplot(3,2,4); plot(ys) title('QRS') end
Answers (1)
Kiran Kintali
on 26 Feb 2018
0 votes
please follow the steps in this getting started tutorial
https://www.mathworks.com/help/hdlcoder/examples/getting-started-with-matlab-to-hdl-workflow.html
the first step is to break the code into design and testbench files.
Categories
Find more on Get Started with HDL Coder 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!