How to convert Matlab .m file to C code?

Please can any one tell me how to convert binary code [1,0] to [+1,-1] using matlab?thanx.?

  • i have a problem in finding any instruction in matlab to convert from the normal binary code to bipoles (biphase) code, to use it in communication system?

  • Answer:

    Multiply by 2 and subtract 1: >> UnipolarVariable = round(rand(5,1)) UnipolarVariable = 1 1 0 1 0 >> BipolarVariable = 2 * UnipolarVariable - 1 BipolarVariable = 1 1 -1 1 -1

mza at Yahoo! Answers Visit the source

Was this solution helpful to you?

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.