Accessing individual contents of cell array for large amount of cells

I have data thats in a cell in form of doubles, and depending on the data set, the length of this cell can range from about 20 to over 100. I need to access the contents of this cell array individually. I know how I can do this using deal, as in the example from doc:

[a,b,c,d] = deal(C{:})

My question: is there a method for automatically creating an array like [trial1 trial2 trial3 ... trial99] for varying lengths (that are specific to the cell length, of course) without actually doing it manually each time?

Sorry if it's confusing...

Thanks in advance!

Ashley
0
Ashley
4/9/2010 8:22:04 PM
comp.soft-sys.matlab 206976 articles. 0 followers. lunamoonmoon (258) is leader. Post Follow

3 Replies
508 Views

Similar Articles

[PageSpeed] 15
"Ashley " <namehere@thisplace.com> wrote in message <hpo29c$n7l$1@fred.mathworks.com>...
> I have data thats in a cell in form of doubles, and depending on the data set, the length of this cell can range from about 20 to over 100. I need to access the contents of this cell array individually. I know how I can do this using deal, as in the example from doc:
> 
> [a,b,c,d] = deal(C{:})
> 
> My question: is there a method for automatically creating an array like [trial1 trial2 trial3 ... trial99] for varying lengths (that are specific to the cell length, of course) without actually doing it manually each time?

No. The actual data in each of the cells is physically in different parts of memory. When you concatenate some or all of them into a single variable you have to copy all of the individual data contents into a new single block of memory. That can only be done by manually doing it each time.  The alternative is to copy *everything* to one array and then access slices of that array. This latter approach has the advantage that it will ultimately will be faster to access your data this way than concatenating the individual cells each time.

James Tursa
0
James
4/9/2010 8:44:05 PM
"James Tursa" <aclassyguy_with_a_k_not_a_c@hotmail.com> wrote in message <hpo3il$d9o$1@fred.mathworks.com>...
> "Ashley " <namehere@thisplace.com> wrote in message <hpo29c$n7l$1@fred.mathworks.com>...
> > I have data thats in a cell in form of doubles, and depending on the data set, the length of this cell can range from about 20 to over 100. I need to access the contents of this cell array individually. I know how I can do this using deal, as in the example from doc:
> > 
> > [a,b,c,d] = deal(C{:})
> > 
> > My question: is there a method for automatically creating an array like [trial1 trial2 trial3 ... trial99] for varying lengths (that are specific to the cell length, of course) without actually doing it manually each time?
> 
> No. The actual data in each of the cells is physically in different parts of memory. When you concatenate some or all of them into a single variable you have to copy all of the individual data contents into a new single block of memory. That can only be done by manually doing it each time.  The alternative is to copy *everything* to one array and then access slices of that array. This latter approach has the advantage that it will ultimately will be faster to access your data this way than concatenating the individual cells each time.
> 
> James Tursa


Thanks, you've saved me a few hours. 

I actually separated the data and put them into nonuniform cells (that's the only way I know how to separate data based on something without having to do it for each new data set) based on the trial number, so i'd like to keep the data separated because I need to manipulate the data within a trial - separate from the other trials. Is there a more efficient way of doing this?

*fyi: trial - from doing a repeated task

Thanks in advance!

Ashley
0
Ashley
4/9/2010 10:37:03 PM
"Ashley " <namehere@thisplace.com> wrote in message <hpoa6f$l41$1@fred.mathworks.com>...

> Thanks, you've saved me a few hours. 
> 
> I actually separated the data and put them into nonuniform cells (that's the only way I know how to separate data based on something without having to do it for each new data set) based on the trial number, so i'd like to keep the data separated because I need to manipulate the data within a trial - separate from the other trials. Is there a more efficient way of doing this?
> 
> *fyi: trial - from doing a repeated task
> 
> Thanks in advance!
> 
> Ashley

I found a way to extract it to a double in separate columns. Problem solved!

Ashley
0
Ashley
4/12/2010 4:39:05 PM
Reply:
Similar Artilces:

Problems while accessing Synchronized method.
Hi, everyone.. Right now i am doing one application in which i am calling one method which is synchronized. ( method signature is like public void synchronize(){} in that method body i am calling two stored procedures in First Strored procedure i am inserting data into database ,,--table1 in Second Strored procedure also i am inserting data into database ,--table2, table1 has primary key called auctionid where as auctionid is the foreing key of table2 when i am calling this method this method says that foreing key conflicts.. i don't know why this is happening.. my database is Ms...

Storing numbers in an array from files
Hi perl gurus, I've been struggling for maniplating a line of numbers. I'd greatly appreciate if you could offer me some help. A file, for instance, contains a bunch of numbers: | 1218, 8, 29 | 3211, 9, 15 I would like to first read in a line of numbers and then would like to uniquely store each number in an array as: For 1st loop | print "$my_array[0]"; <--displays 1218 | print "$my_array[1]"; <--displays 8 | print "$my_array[2]"; <--displays 29 For 2nd loop | print "$my_array[0]&quo...

Combining Outlook and Access
Is there a way to have text in an outlook email return a value from an access table??? For example, if I get an email with a part number in it, can I some how make it so that I can see the price of the part number with just a click? I am looking for something similar to 'smart tags', I think. On Fri, 27 Jul 2007 19:15:45 -0000, TommyG <tgilbride@hotmail.com> wrote: I don't know if smart tags could work. I know an Outlook add-in could. Presumably the code would have to be able to find the partnumber in the body of the text, perhaps using a regular expression, and then it ...

Progress and Microsoft Access
I wonder if some can help me. I have a client who has a system created in Progress. He needs to the system to be able to write data to a Microsoft Access database. He has been informed that this requires an Access ODBC driver that costs �250 per seat. And this would take 3 days programming to achieve. Has anyone undertaken the writing of data to Access, and is the above correct ? Thanks, D mcderd@yahoo.com (Dennis) writes: >I wonder if some can help me. >I have a client who has a system created in Progress. >He needs to the system to be able to write data...

Re: Call Symput and accessing macro variable in same dataset
%macro test; %local count; data xx; mon=6; call symput('count',mon); count=symget("count"); put "Unable to access " count=; run; %mend; %test; You cannot access the macro variable which you are creating in the dataset within the dataset just by using &macroname. You have to use Symget to do the same. HTH Monal --- Rajat Mathur <RMathur@INDUCTIS.COM> wrote: > Hi, > > I am attaching a code snippet I am unable to access > a macro variable in > the same dataset where it is created by using call > symput. > Can anyone help...

Access windows applications from AIX SAS "X" Command and "Call Module"
Hi, I have SAS 9.2 installed (Pretty much all licenses) on AIX server and EG 4.= 2 on my PC. I am working on series of SAS programs which needs to be execut= ed step by step; kinda uses output from one program as input for next progr= am. So at one of the step, the program calls in 'X' Command as followed %IF &N. =3D 8 %THEN %DO; DATA _NULL_; X 'C:\AHRQQI\AHRQPrediction\AHRQ.exe C:\AHRQQI\IQI\Prediction_PIQ08.xml'; RUN; %END; with this step there will be an output generated on PC; after this step the= re is other SAS program uses this output to ...

TCP/IP access in Postgresql 8 Windows
Hi, I'm pretty versed in Postgresql version 7.* on Linux. Need to setup a 8.* server on Windows. Postgresql 8 is rejecting TCP/IP connections. Tried to acivate tcpip_sockets, as in the 7.4.* versions, configuring postgresql.conf param tcpip_sockets, but it is not recognized by version 8 (it even fails to start if included). Client IP's have an entry in pg_hba.conf. Is there any other task that must be done in order to get TCP/IP connections working? TIA, -- Werner Bohl <WernerBohl@infutor.com> Infutor de Costa Rica S.A. ---------------------------(end of broadcast)------...

Sorting a Cell Array with Multiple Data types
I have a table of data stored as a cell array that I need to sort into an order based on part of one the rows. Here is the table: (called "Table") 'MAR - Groups Total' 'CE1' 'CE2' 'CE3' 'CE5' 'CE6' 'CE7' 'CE8' 'Total' 'Forecast' [27.6900] [62.1000] [88.0900] [62.4000] [73.5400] [ 94.2500] [80.2600] [488.3300] 'Actual' [29.0600] [69.8500] [92.9400] [61.2700] [82....

Method missing and arrays as arguments..
How do you go about passing arrays as arguments to something like method_missing? I've got a method that takes an array as an argument, but calling it via method_missing is proving problematic. How do you deal with arrays in these situations? def table_row(values) # values is the list of items in the table row #.... end def method_missing(method,*args) if respond_to?method.to_s[/^add_([^$]+)/,1] @data<<method(method.to_s[/^add_([^$]+)/,1]).call(*args) else super method_missing(method,*args) end end --Kyle On Apr 6, 2009, at 4:35 PM, ...

send and receive a large byte[] over network?
Hi,Would anyone please suggest me a solution to send/receive a largebyte[] (about 300.000 elements) over network? Currently, I amclueless.Thanks knguyen wrote:> Would anyone please suggest me a solution to send/receive a large> byte[] (about 300.000 elements) over network? Currently, I am> clueless.It is hard to suggest the ideal solution when the problem is this underspecified, but I will stick with the most generic solution:Open up a Socket to the desired computer and port, take its inputStream, and then use the write(byte[]) method of said stream to send the data.If the bandwidth i...

Accessing Access
Hello, what would be a good module for accessing data contained in a MS Access database file? Are there any examples of doing this that you know of? In article <nn1Ah.2617$2%1.2205@trndny02>, <QoS@domain.invalid.com> wrote: > >Hello, what would be a good module for accessing data contained in >a MS Access database file? Are there any examples of doing this >that you know of? Depends what kind of platform you can use. If you are under Windows, DBD::ODBC will work wonders. If you `bridge' Windows <-> Unix, you can set up a DBI::ProxyServer on a windows...

VBA script to add a named cell to each vaule in a named range.
Greetings once again. I have a spread sheet laid out in the following format. Sheet=Data Column A contains dates. Columb B contains values specific to column A. (Named range = Jan02) Column C contains dates. Column D contains values specific to column C. (Named Range = Feb02) -break- Column CE contains dates. Column CF contains values specific to column CE. (Named Range = Jun05) On another tab Sheet=Summary I have named cells Cell B4=mw Cell B5=add Cell B6=opt Cell B7=cap Now I have my ranges laid out, this is what I am trying to accomplish: I want to take range.JAN...

PostGreSQL to Access Updatable recordset
I have a postgresql backend with an access front end and I am trying to redefine the recordset of the form to use an ADO recordset. The problem is that the CursorType always changes to AdOpenStatic, even if I choose adOpenDynamic. If anyone has any thoughts, please let me know. The form works great for viewing, but I cannot update or insert any new records. Below is the code I am using: connectstr = "DSN=SAP_PG;uid=postgres" Set conn = New ADODB.Connection conn.Open (connectstr) rs.CursorLocation = adUseClient rs.Open "select ProductID,ProductNam...

Accessing Data within while loops
I have LabView 6.0 I have a while loop for my GUI that accesses various sub VIs. One of the Sub VI is a LED&nbsp;on/off thing, which basically checks the communication with the PIC board that I have. For turning the LED on or off, I have to sent a unique command. Since the Sub VI for the LED on/off is inside a while loop it continuously executes. I want the SubVI to execute only when the status of the boolean controlling the LED has changed from the previous value. I tried giving a feedback from the SubVI to indicate whether there is a change, but Labview will not allow such loops. I the...

Re: Arrays and Counting #3
Thank you so much for your quick reply. This works perfectly! -Trish ...

Airport Extreme
Adding security to my airport extreme so that other iMacs connecting through the airport is easy enough to set up. All machines connect wirelessly. I would like to add a PC with wireless connectivity and having a few problems. I can connect the PC if the Airport Extreme is open and has no security, but unable to connect if I add security. Is there a specific length of numbers that I must use in the password? If so what is that number? Thanks for feedback mpmail <mpmail@grandecom.net> writes: > I can connect the PC if the Airport Extreme is open and has > no security, but una...

Export DDL of Access 2002 Database
I want to export DDL of an existing Database Microsoft Access 2002. I could write a routine that navigate into the TableDef of the DB. Exist something snippet code that do this? thanks On 31 Mar 2006 00:57:23 -0800, "kenshiro2000" <kenshiro2000@libero.it> wrote: >I want to export DDL of an existing Database Microsoft Access 2002. I >could write a routine that navigate into the TableDef of the DB. Exist >something snippet code that do this? > >thanks see recent thread http://groups.google.co.uk/group/comp.databases.ms-access/browse_frm/thread/7dbfecb6c958815c...

How to create an indicator matrix out of a cell array?
Say I have a cell array: X= {'one';'two';'one';'one';'three';'one';'three';'three';'thre e';'two';'two'}; What I need is an "indicator" or "design" matrix (I'm using both terms loosely here) showing the positions of distinct elements of X. In this example there are 3 distinct elements in the cell array: 'one', 'two', and 'three'. So my indicator matrix would have three columns, one for each element. The first column would have number 1 in place of '...

Widget access
how to make the widgets defined inside the function available outside it without using OOPs concept? arvind enlightened us with: > how to make the widgets defined inside the function available > outside it without using OOPs concept? Why wouldn't you want to use OOP? Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself? Frank Zappa arvind enlightened us with: > how to mak...

Jinitiator
Hi all, can somebody explain me what is the meaning of the choice "Network Access" in the control panel of JInitiator ? Thank you in advance ...

just need to create share to access via XP ?
Hi, How do I create a share on SKO UNIX that I can access via windows XP ? Thanks for any information at all. Scott need to make sure samba is installed. ...

Get Data from SQL to Access
Please help me decided the best way to do this... I have a shopping cart web site that stores its data in an SQL server database. The client wants to retrieve daily orders via their access DB on their desktop. I have written macros to connect to the same SQL server, retrieve data and process data on my desktop. But What I'd like to do is... ..Display a list of open orders, etc, allow the client to select which items to transfer from the live to the desktop. How can I do this? Can someone point me to an example of data retrieval and display for action in Access? thank you in advance. ...

Could not access the MCR component cache
Hi eveyone, I am using a MATLAB compiled library in Linux environment but when want to access it and run my c++ code, I receive this message: "Could not access the MCR component cache". I am pretty sure that this is linux pathing issue and I wonder what this message means and what file the system is unable to access. Any help is much appreciated. Thanks, Zohair "Zohair" wrote in message <httdpd$90k$1@fred.mathworks.com>... > Hi eveyone, > > I am using a MATLAB compiled library in Linux environment but when want to access it and run my c++ c...

how to create a LOG array from A to B
Hello guys, If I want to create an array of N positions from A to B I can do it like this : result=FINDGEN(N)*(B-A)/(N-1)+A Right now I would like to create the same array but with a logaritmic "distribution" and for any positive A and B. For example, for A = 0, B = 1 and N=10 the result should be ALOG10(1+FINDGEN(10)) This is easy if A and B are powers of 10 but I don't know how to solve this problem with any other numbers. Thnak you in advance for your help, nata On 1/12/12 12:27 PM, nata wrote: > Hello guys, > > If I want to create an array of N positions from A ...

insert row into an array
Now we have : a = [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] >> b b = [] [1] [] [] [] >> new_row = 2; a=[a(1:(new_row-1),:) b a((new_row:end),:)] ??? Error using ==> horzcat All matrices on a row in the bracketed expression must have the same number of rows. and when i use a=[a(1,:) b a(2,:)] a = [] [] [] [] [] [] [1] [] [] [] [] [] [] [] [] sean def wrote: > Now we have : > > a = > > [] [] [] [] [] > [] [] [] [] [] > [] [] [] [] [] > [] [] [] [] [] &g...