0

I got an array with values which are either 1 or 2 like:

val = [1,2,2,1,...]

Now I want to generate a new array in which every value of val is replaced with a String like:

str = {'accept', 'not accept','not accept', 'accept',...}

Can someone help me to get it done with Matlab?

Thanks in advance!

1 Answer 1

1

Suppose you have a cell like options = {'accept', 'not accept'}. One solution can be:

str =options(val)

So, if val = [1 2 2 1 ...] the result would be:

str = {'accept', 'not accept','not accept', 'accept',...}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.