The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

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

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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.