[Scilab-users] Help re-designing a code
samaelkreutz
mariajovera at icloud.com
Wed Aug 21 04:57:10 CEST 2013
Hello people, If you can help me would be awesome. It's very simple
(unfourtunaly not for me). I have a data set, and... then I have to select
only specifics subsets. I design an algorithm... that is repetitive and
simple. I must re-sign (if possible with for cycles) and then save the
subsets in a txt file.
This is my code:
___________________________________________________________________
clear all
clc
A=fscanfMat('search.txt') // Load the matrix
lat=A(:,8); //Latitude
lon=A(:,9); //Longitude
depth=A(:,10);
//Data must be divided in 3 subsections:
// SUBCTIONS 1, 2 AND 3:
le= -34 ; //required start latitude
ls= -35 ; // required stop latitude
a_in=find(A(:,8)>=(ls) & A(:,8)<=(le));
// Evaluating and creating new matrix for specific latitude:
mat1=A(a_in,:);
clear ls le a_in
// Now i have to divide in 3 portions:
//__________________________________________________________
//section: 1
le= -73.0 ; // start longitude
ls= -74.0 ; // stop longitude
a_in=find(mat1(:,9)>=(ls) & mat1(:,9)<=(le));
C1=A(a_in,:);
clear le ls a_in
//%__________________________________________________________
//%Section 2
le= -72.0 ; // start longitude
ls= -73.0 ; // stop longitude
a_in=find(mat1(:,9)>=(ls) & mat1(:,9)<=(le));
C2=A(a_in,:);
clear le ls a_in
//%__________________________________________________________
//%section 3
le= -71.0 ; // start longitude
ls= -72.0 ; // stop longitude
a_in=find(mat1(:,9)>=(ls) & mat1(:,9)<=(le));
C3=A(a_in,:);
clear le ls a_in
*How can I export the data C1,C2,C3 in a txt file? (separated to each
other, of course)*
search.txt <http://mailinglists.scilab.org/file/n4027261/search.txt>
Thank u very much!!
--
View this message in context: http://mailinglists.scilab.org/Help-re-designing-a-code-tp4027261.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
More information about the users
mailing list