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
 compare matrices

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
freppie Posted - 01/10/2012 : 10:27:00 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8.1 SR3
Operating System:Windows Xp professional

Hi!

I am new to origin and I am testing it out with some of my data where I need some help...

Basically I have 2 matrices of the same size and I want to create a new matrix where the highest value is taken and where I can get a percentage of how many samples that were taken from each matrix. So a nice if statement would be fine here (if mat1>mat2, then mat1 otherwise mat2) and I have been checking around and trying the "Set Values" function that can do many manipulations but not this what I can see. I am sure there is an easy answer to this for a newbie like me...

Thanks in advance and sorry for taking up your time!
1   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 01/11/2012 : 2:46:03 PM
Hi,

The following single command using the conditional operator in the 
Script window does the job: 

  Mbook3=mbook1>mbook2?mbook1:mbook2;

To count how many cells in MBook3 are equal to the cells in MBook1 
(assuming no same values common both in MBook1 and MBook2),
you can do the following (with a second intermediate matrix, Mbook4): 

  mbook4=(mbook3-mbook1)>0?0:1; //round up
  m2w method:=xyz;  //convert to a woksheet
  sum(col(C)); //get simple stats
  sum.N=;  //number of cells
  sum.total=;  //cells of 1
  sum.total/sum.N=;  //percent value

Hope this works for your task.

--Hideo Fujii
OriginLab

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