vector manipulation

Hi,
I wrote a simple code in matlab to create an histogram for the integral of the data separated in "events"

//Ndata Nevent dat1 dat2 dat3 dat4
0 1 8530 8782 8669 8756
1 1 8530 8782 8669 8753
2 1 8531 8784 8670 8756
3 1 8530 8782 8670 8756
4 1 8530 8780 8671 8754
5 1 8531 8780 8670 8756
6 1 8529 8781 8668 8757
7 1 8531 8779 8669 8755
8 1 8531 8781 8669 8753
9 1 8532 8783 8668 8755
10 1 8531 8781 8668 8756
11 1 8531 8781 8670 8755
12 2 8529 8782 8669 8754
13 2 8530 8782 8669 8755
14 2 8530 8780 8670 8755
15 2 8531 8780 8668 8754
.... ... ..... ... .... ....


1
2
3
4
5
6
7
8
9
10
11
12
13
  	muest=data(:,1);
	ev=data(:,2);
	ch1=data(:,3);
	totalmuestras=length(muest);
	totaleventos=max(ev);
	H=zeros(totaleventos,1);
	for i=1:totaleventos
	    for j=1:26
	        H(i)=H(i)+1*ch1(j+26*(i-1));
	    end
	end
	nbins=max(H)-min(H);


I want translate this code to C++, my problem is how know what is the best estrategy (library) to manipulate vectors and open the file
i can use ifstream or fopen i dont know.
hopefully they can guide me.
thanks.
Topic archived. No new replies allowed.