Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: find and replace a value between two arrays
Replies: 1   Last Post: Jan 10, 2012 9:06 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
george

Posts: 17
Registered: 12/16/08
find and replace a value between two arrays
Posted: Jan 10, 2012 8:27 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,
I have two arrays.
The first is like this : A=[1,0;1,0;1,0;2,0;2,0;3,0;3,0;3,0;3,0]
The second is like this B=[1,'M';2,'F';3,'M';4,'F']
The problem i have is to make an algorithm : to replace in A array the "0"
with 'M' when its 1
with 'F' when its 2
with M when its 3
And if there isn't the value in A array to find next such as 4,'F', that there isn't in A array

PS: this is an example..I have thousands of values in the arrays


I appriciate if you help me!!



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.