The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 delete data from a 1024x1024

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
javiersb Posted - 12/04/2005 : 9:33:48 PM
Origin Version (Select Help-->About Origin): 6.0 and 7.5
Operating System:wxp

Hi dear Origin members, I would be really grateful if you could point me out how to delete all data larger than 0 from a 1024 columns and 1024 rows worksheet.

thanks for your help.
4   L A T E S T    R E P L I E S    (Newest First)
javiersb Posted - 12/05/2005 : 09:41:48 AM
Heyyyy!!!!!
Once again thanks a lot, Easwar I am really impressed with your quick and perfect responses. It is really nice to find people like you.

Have a nice day
easwar Posted - 12/05/2005 : 09:28:33 AM
Hi Javier,

From the GUI you can simply highlight/select all cols of the wks and then use the menu item Statistics->Descriptive Statistics->Statistics on Rows, which will generate a new worksheet with all stats for each row of the wks.

You could instead use the following script segment, which would add two cols to the end of the wks, and put the mean and sd value in those cols for the data in each row.


// Get num rows and cols of wks
ncols = wks.ncols;
nrows = wks.nrows;
// Add two cols at end for mean and sd
wks.addcol(Mean);
wks.addcol(SD);
// create temp dataset
temp={};
// set stats object to use temp dataset
stat.DS.data$=temp;
// loop over all rows
for(ir = 1; ir <= nrows; ir++)
{
// loop over all cols and fill temp
for(ic= 1; ic <= ncols; ic++)
{
temp[ic]=cell(ir,ic);
}
// do stats on temp
stat.DS();
// save mean and sd to last cols
cell(ir,ic)=stat.ds.mean;
cell(ir,ic+1)=stat.ds.sd;
}
// delete temp dataset
del temp;




As for matrix, you can access matrix cells with the cell(i,j) function as well. In the matrix case, you could decide where to put the stats results. For example it could go into a worksheet in which case you can look up script command to make a new wks and then put the stats results in there.

Easwar
OriginLab

javiersb Posted - 12/05/2005 : 08:45:32 AM
Leo, thanks a lot for your help I did not realize that was so easy. I am sorry, but I have another question do you know if it is possible to calculate , mean and standard deviation on worksheets or matrix row by row? (I have 1024 rows).

Thanks a lot

Javier
Leo_Li Posted - 12/04/2005 : 11:31:45 PM
Hello javiersb,

If your data are in a worksheet:

1. Edit -> Convert to Matrix -> Direct, Click "Convert".

2. Matrix -> Set Values: Enter the expression:

(Cell(i,j) > 0) ? NANUM : Cell(i, j)

Click "OK".

3. Edit -> Convert to Worksheet -> Direct.

If your data are already in a Matrix window, just do step 2.

Leo
OriginLab

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000