[Scilab-users] "Re-sampling" data and making 2 vectors
CRETE Denis
denis.crete at thalesgroup.com
Fri Jan 11 16:20:46 CET 2013
Hello,
If I understand correctly, this should do the job
// select rows corresponding at the same (exact) time in col 1 for Data1 and col.8 for Data2
[v,k1,k2]=intersect(Data1(:,1), Data2(:,8));
// Extract the desired values of temperature (in col. 2 for Data1 and col. 4 for Data2)
Temp1=Data1(k1,2);
Temp2=Data2(k2,4);
Disp([v,Temp1,Temp2,Temp2-(Temp1-mean(Temp1))]); // (or mean(Data1), up to you)
It is also possible to interpolate the values of Data2 for the time values in Data1(:,1) with interp1 (cf. Scilab help)
HTH
Denis
-----Message d'origine-----
De : users-bounces at lists.scilab.org [mailto:users-bounces at lists.scilab.org] De la part de Jaquelineanbarr
Envoyé : vendredi 11 janvier 2013 14:58
À : users at lists.scilab.org
Objet : [Scilab-users] "Re-sampling" data and making 2 vectors
Hello, Im working with matrices with different samplings.
First data
//time Temp sq
091532.0 23220.37 96
091535.0 23221.34 95
091538.0 23220.64 95
Second data
//X Y elevation Tem sq corrTem sat time massx mssy line
0375716.06 7436112.26 001179 22837.15 99 000000.00 10 135924.5 0 0
0375716.06 7436112.24 001179 22834.21 99 000000.00 10 135925.0 0 0
0375716.06 7436112.23 001179 22834.92 99 000000.00 10 135925.5 0 0
0375716.06 7436112.23 001179 22833.72 99 000000.00 10 135926.0 0 0
0375716.05 7436112.23 001179 22834.02 99 000000.00 10 135926.5 0 0
0375716.05 7436112.22 001179 22833.26 99 000000.00 10 135927.0 0 0
0375716.09 7436112.27 001179 22822.27 99 000000.00 10 135927.5 0 0
0375716.21 7436112.44 001179 22798.54 99 000000.00 10 135928.0 0 0
(is not the complete data, is an example) My problem is data1 is longer than data2. With data 1 i have one value of temperature each 3 seconds, meanwhile in data 2 I have one value of temperature each half second.
I have to "cut" the matrixes, they should have the same lenght (because I need Data2-(Data1-mean(Data1)) , and starts at the comun hour. I dont know how do it, Any suggest?
The format of the time is for example 072301 (07:23:01)
--
View this message in context: http://mailinglists.scilab.org/Re-sampling-data-and-making-2-vectors-tp4025657.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
_______________________________________________
users mailing list
users at lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
More information about the users
mailing list