Active2 years, 2 months ago

For an example exam question, I've been asked to 'tangle' a string as shown:

Scrambler Program In Matlab Download

This source codes are developed in MATLAB, VHDL, VERILOG and LABVIEW Programming languages. These codes are useful for beginners in the field of signal processing, image processing and communication domain. Scrambler and descrambler, READ MORE. Interleaver and deinterleaver matlab code, READ MORE. Data Modulation, READ MORE. How to write a function to scramble letters? Learn more about matlab function, string, random. How to write a function to scramble letters? Learn more about matlab function, string, random.

Scrambler Program In Matlab

I understand this is an extremely simple problem but it's got me stumped.

I can make it produce a tangled word when the length is even, but I'm having trouble when it's odd, here's my function:

If you've waited in vain for a.22 LR version of a favorite centerfire semiautomatic pistol like the Springfield Armory XD, maybe it's time to settle for the Walther P22. Photo by Mark Wynn. Instruction manual for walther p22.

Sardar Usama
16.4k8 gold badges27 silver badges49 bronze badges
AidanLeithAidanLeith

3 Answers

For odd word length, you need to reduce n by 1 to leave the last char untouched. Use mod to detect odd word length.

DanielDaniel
33.2k3 gold badges26 silver badges58 bronze badges

If you want to scramble every char randomly, you can try:

shuffled = 5741326

If you want to change the first two chars:

tangled = 2134567

If you want to change every two chars:

tangled2 = 2143657

Matt

Scrambler Program In Matlab Free

6,9852 gold badges17 silver badges33 bronze badges
OddNorgOddNorg
Sardar Usama
16.4k8 gold badges27 silver badges49 bronze badges
Tee IanTee Ian

Linear Convolution Program In Matlab

Not the answer you're looking for? Browse other questions tagged stringmatlab or ask your own question.

Coments are closed
© 2020 - d1lyi.netlify.com
Scroll to top