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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 delete data from a 1024x1024
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

javiersb

USA
Posts

Posted - 12/04/2005 :  9:33:48 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

Leo_Li

China
Posts

Posted - 12/04/2005 :  11:31:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

javiersb

USA
Posts

Posted - 12/05/2005 :  08:45:32 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

easwar

USA
1964 Posts

Posted - 12/05/2005 :  09:28:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Go to Top of Page

javiersb

USA
Posts

Posted - 12/05/2005 :  09:41:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000