f



Collect Data from corresponding Columns

I have 3 vectors with data in them: Time, Variable A, Variable B

I have time listed as a character, but what I want to be able to do is type in two boundary time points so then the data that is within the time boundaries from vector Variable A or B can be collected and analyzed. Essentially, I want to collect the data from the corresponding time columns as set by the boundary times I have typed in. Example below:

data01.txt has the following information


Time          Variable A               Variable B
00:01             4                            3
00:03             5                            3
00:09             6                            4
00:11             5                            3
00:12             6                            7
00:15             6                            4
00:18             4                            6
00:22             6                            3

I created a struct that holds each of these variable (ex. data01.Time). Now I want to add the appropriate code that would allow me to type in a lower time boundary (ex. 00:01) and upper time boundary (ex. 00:11) and collect the data from data01.VariableA or data01.VariableB between these times and add them to new vectors. If anyone could help that would be great!
0
D
8/2/2014 5:37:10 PM
comp.soft-sys.matlab 211265 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

1 Replies
446 Views

Similar Articles

[PageSpeed] 3

On 08/02/2014 12:37 PM, D Gal wrote:
> I have 3 vectors with data in them: Time, Variable A, Variable B
>
> I have time listed as a character, but what I want to be able to do is
> type in two boundary time points so then the data that is within the
> time boundaries from vector Variable A or B can be collected and
> analyzed. ...

Just answered essentially the same query (two file instead of one only 
real difference) at the Answers Forum

<http://www.mathworks.com/matlabcentral/answers/144387-change-of-data-format>

--
0
dpb
8/2/2014 6:21:06 PM
Reply:

Similar Artilces:

How to read every data in the first column corresponding to the every data in the second column in the TABLE CONTROL?
Hello everyone &nbsp; like this table &nbsp; 0.0001&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -4.6 0.0002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -4.3 0.0004&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -4.0 0.0006 0.0008 0.001 &nbsp; I want to get&nbsp; pairs (0.0001, -4.6) (0.0001, -4.3)&nbsp; (0.0001,&nbsp; -4.0) (0.0002,&nbsp; -4.6) (0.0002,&nbsp; -4.3) (0.0002,&nbsp; -4.0) (0.0004,&nbsp; -4.6) (0.0004,&n...

writing data in Excel in column from Matlab
I am trying to write results of an array called ifuelConsumpList from matlab to excel in a column using the following line. [status,msginfo]=xlswrite('F:\\testdata2.xlsx', ifuelConsumpList,1, 'B2:B4001'); But this command is storing only the first element of the array 4001 times in the 4001 cells of the column. However, if I use the following command, I get the correct results but the results are stored in a row (which I don't want, I want in a column). [status,msginfo]=xlswrite('F:\\testdata2.xlsx', ifuelConsumpList,1, 'B2'); Note that the diffe...

COLLECT
Hi all, I'm looking for an aggregation function that can join collections to a new collection. I found nothing like this. An example: DDL: CREATE TABLE TEST_TAB ( GROUP1 NUMBER, GROUP2 NUMBER, VAL NUMBER ); DML: Insert into TEST_TAB (GROUP1, GROUP2, VAL) Values (1, 5, 2); Insert into TEST_TAB (GROUP1, GROUP2, VAL) Values (1, 5, 3); Insert into TEST_TAB (GROUP1, GROUP2, VAL) Values (1, 6, 1); Insert into TEST_TAB (GROUP1, GROUP2, VAL) Values (1, 6, 1); Insert into TEST_TAB (GROUP1, GROUP2, VAL) Values (1, 6, 6); Insert into TEST_TAB (GROUP1, G...

transposing column data into columns
I have a table of populations of cities (identified by country, state, cities) on particular dates. How do I transpose the date values in my rows to a date value column that lists populations for that date. In other words go from this: Date Country State City Population 12/20 US IL Flora 1432 12/19 US IL Flora 1427 12/18 US IL Flora 1425 12/20 US AR Flora 1432 12/19 US AR Flora 1432 12/18 US AR Flora 1432 12/20 US AR Dan 1200 12/19 US AR Dan 1200 12/18 US AR ...

Data, data, data,
I have been tasked to dump around 400GB of data in physical files into a flat files and the transfer them from an iSeries 810 V5r3 to a windows server. I was going to CPYTOIMPF to a stram file and then copy over to the Windows server from the IFS. Anyone have a better idea or any suggestions? Thanks, Thad Rizzi Hi Thad If you have loads of free disk space on your 810 then your method is fine but if not you may consider Simply FTPing or iSeroes Access file transfering the files directly from the iSeries files to Windows Text file. You can get the either FTP or iSeries Access to carry out...

Export data as well as the corresponding column names?
Hello, Is there a way to export the data from some tables, along with their corresponding column names? I know I can use "export" command to export the data from a table to a DEL file (the users need to be able to read the file directly, which leaves the choice of a DEL file), but only the data will be in the file. The users would like to see the column names side by side with the data as well. I wonder if there is an easy way to do so without too much coding. Thanks. Use ixf format will have table DDL, include the column name. But not readable directly. The easy way i...

Collecting data from Info Plus 21 in Matlab
Hello all, I am interested in building an application which uses data from an Aspen Tech Info Plus 21 (IP21) historian. I can get the data from IP21 into text files then import those text files into Matlab. However I am searching for a method to import a batch of data from IP 21 using some selection criteria like time range. IP 21 uses SQL Plus, I am not sure if I can use SQL Plus in Matlab. Anyone has any ideas? Regards, Ian ...

Restart Matlab after every run of serial data collection
Hey guys, I am trying to obtain real time streaming data from a sensor in Matlab via the COM port. However after every time I run the code, I am having to restart Matlab. this is because if I try to execute the code more than once, I get a message that says that the COM port is not available. Regards Sudarshan "Sudarshan Ragunathan" <sragunat@asu.edu> wrote in message news:fu1dvt$jik$1@fred.mathworks.com... > Hey guys, > I am trying to obtain real time streaming data from a sensor > in Matlab via the COM port. However after every time I run > th...

How do I retrieve data in matlab database using column name (where clause)?
How do I retrieve data in matlab database using column name (where clause)? I've tried this but it doesn't work: catgQuery = strcat('select ID from MyTable where ColumnName= ', Category); catgCurs = exec(conn,catgQuery); catgResult = fetch(catgCurs); r1 = catgResult.data ...

How to get single column of row data of an .xls file by xlsread() in Matlab?
Hi, I would like to read in a whole column (or row) of an excle file by xlsread() (or some other functions that can achieve the same goal) in Matlab. For example, if I would like to read the 'BV' column only, I tried the below command: [num txt raw] = xlsread(fname, '', 'BV'); %fname is the .xls filename But I got an error of "Data range is invalid". Certainly, if I do like below for specific rows (row 1 and row 2 here) in the column 'BV' [num txt raw] = xlsread(fname, '', 'BV1:BV2');, then I can get it read out. But the problem is t...

convert row-data to column data
I'm quite new to awk scripting, and i haven't been able to solve this problem: I have this data file: http://www.cs.kuleuven.ac.be/~bartv/downloads/sslog500_1_0p041_12.txt I would like to use the data from that datafile in gnuplot, which expects the data as columns. Now the data in my file is stored in the even rows. How do i transform the data from the even rows in to columns? The best i could come up with up until now is http://www.cs.kuleuven.ac.be/~bartv/downloads/convert.awk but this does not give me what i want. The row-data is indeed changed to column data, but the colu...

Import data or Read data into Matlab
Hey everyone, Good day, I have got a problem now. I am going to read the txt file into Matlab which contains the data with the format as following (extract as instance) 0 0 1 0 1224 1223 2002 2003 2004 0 40989 3924 13599 0 502 3911 6740 2560 7984 8919 8920 1977 8422 2 3 4 4 it was separated by space, when i try to use the import data wizard, it can only read two columns, i am thinking is it because of empty area can not be recognized... Because i am going to read the entire file as a matrix. I am also trying to use the code to read, but not really works either. Can anybody help me, a...

how to store more data in data base column
hi &nbsp; i want to store 801 values in one column of data base. i tried but i was able to store/write only 10 values.can any boly help me in this matter........ I think this is the same topic. <a href="http://forums.ni.com/ni/board/message?board.id=170&amp;thread.id=322818&amp;jump=true" target="_blank">continue here</a> Is this part of a class project?&nbsp; There are two similar questions from different users. &nbsp; How were the fields defined in your database?&nbsp; Will it support 801 values? How many characters are allowed in th...

Convert rows data to column data
I have the following data returned by this query: SELECT TOP 20 t.ID, t.Name FROM tblContacts t ORDER BY t.Name ID NAME 1 Betty 3 Jane 4 Mary 2 Susan .... 20 Zelda What I want to do is to insert the results above into a temp table so that this query: SELECT Name1, Name2, Name3, Name4, .... Name20 FROM #TempTable returns the following recordset: Name1 = Betty Name2 = Jane Name3 = Mary Name4 = Susan ,,, Name20 = Zelda There will always be 20 rows created by the first query so the temp could have 20 static column names. I'm at a loss to figure out how to construct t...

Web resources about - Collect Data from corresponding Columns - comp.soft-sys.matlab

Spotify video streaming rolls out to Android users
Video streaming has finally arrived to Spotify on Android devices, giving you more entertainment than just audio. As earlier reports revealed, ...

Search Reason: planned parenthood videos
Words are words and bullets are bullets. You'd expect journalists to understand that.

You’re going to love Apple’s Night Shift mode in iOS 9.3
On Monday, Jan. 25 , Apple introduced iOS 9.3 beta 2. The iOS update , which should publicly launch in a few weeks, has many new features. The ...

Flint schoolkids will get 6.5 million bottles of water from Coca-Cola and Pepsi
FLINT, Mich. — Walmart and several global beverage-makers have pledged to deliver about 175 truckloads of bottled water to Flint as the Michigan ...

Uber is using smartphone data to alert it to bad drivers
Although Uber's review system allows both riders and drivers to submit feedback on a recent journey, it can be hard for the company to know what ...

Twitter Taps Amex’s Leslie Berland as CMO
Twitter has hired Leslie Berland, a top marketing exec with American Express, as chief marketing officer. CEO Jack Dorsey announced her appointment ...

Wall Street still loves Apple even if iPhone sales are falling
Business Insider Wall Street still loves Apple even if iPhone sales are falling Business Insider Apple will announce its first-quarter earnings ...

This iPhone 7 concept looks like something Apple may really release
We’re used to see all sorts of wild iPhone concepts over the years, and most of them feature wild designs and ideas that Apple is not likely ...

Professor who blocked a student reporter from reporting last year has been charged with assault
https://youtu.be/xRlRAyulN4o Dr. Melissa Click, the University of Missouri professor who blocked a student reporter from reporting on a campus ...

Sony moves PlayStation to the US with new Sony Interactive Entertainment
(credit: Flickr ) Electronics giant Sony has formed Sony Interactive Entertainment LLC (SIE) , a new company that combines Sony Computer Entertainment ...

Resources last updated: 1/26/2016 4:00:47 PM