MATLAB: Wsn importing data data from other file

data coolectionloading a dataSimulink Desktop Real-Timewsn

load H11; % load file name say H11
r1 = H11(1:100,2); %2,3 and 7th sensors are closely deployed
r2 = H11(1:100,3);
r3 = H11(1:100,7);
If h11 file contains sensing data of all sensor…then how we can replace this code with actual sensing data…..can you give me some example for replacing this file with actual sensing data here itself

Best Answer

I think that should work if H11 is both a string that is the filename, i.e. 'H11.mat' and it is also the name of the array stored inside the H11.mat file. So, prior to this you, or someone, would have created a file called H11.mat by doing something like
save('H11.mat', 'H11');
to save the H11 array in "H11.mat" file. Then, r1 will give the first 100 elements in column 2 of H11, and similar for r2 and r3. I'm not sure what you mean by "actual sensing data" - isn't that what's in the H11 array that you read in from the mat file?