MATLAB: I want to design xilinx histogram block for MATLAB 7.4.0(R2007) in system generator .I wrote M-Code and simulating but i am geting error at line 2 of following program.Please any one help me to create M-Block for histogram.

design of xilinx block for histogram block in system generator

function pr = srinu(a)
load newfile.txt;
a=newfile(:,1);
z=xlmax1(a);
% figure(1)
%plot(z)
sum(z)
figure(2);
pr=z./1000; %you must divide by number of sample to get probability of each bin
stem(pr)% this might be your histogram according to your code
% xlabel('Bin number','FontSize',10,'FontWeight','bold');
%ylabel('Probability','FontSize',10,'FontWeight','bold');
end

Best Answer

Replace the load with
newfile = load('newfile.txt');
Related Question