Prev: when to stop a simulate annealing when it doesn't stop by itself
Next: creating distribution of clusters within a matrix
From: Rami Sabouni on 2 Jun 2010 17:58 Dear All, I doing a test on the IEEE 802.11a model that is in simulink, and I want to compare the input of the wireless connection with the output to find what is the packet error rate and the bit error rate when applying different conditions on the wireless connection. I was able to save the input and the output (as binary code) of the wireless connection in two different mat files as 1036800x1 double array, so what is the best way to compare these two files together "bit by bit" and if they match I want to keep it 0 and if not to make it 1 and save the result in another array. or if there is another way in simulink that can give record the input and output and compare them directly and get me what I am looking for. hope that I can get a solution for my problem. Thx
From: Jeremias Sauceda on 8 Jun 2010 17:49
Rami, You should load the .mat files in MATLAB Once you have the vectors in variables, say x and y you should do the following: To know whether they differ type: >> ~all(x == y) This will return 0 if equal, 1 otherwise To know indexes where vectors differ type: >> z = x == y >> find(~z) Jeremias Sauceda ------------------------ SimDiff and SimMerge, the de-facto worldwide industry standard for collaborative development of Simulink, Stateflow, and TargetLink models. |