Q:

Two variables store strings that consist of a letter of the alphabet, a blank space, and a number (in the form ‘R 14.3’). Write a script that would initialize two such variables

0

Two variables store strings that consist of a letter of the alphabet, a blank space, and a number (in the form ‘R 14.3’). Write a script that would initialize two such variables. Then, use string manipulating functions to extract the numbers from the strings and add them together.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Ch7Ex24.m

% Creates two strings in the form 'R 14.3', extracts

% the numbers, and adds them together

str1 = 'k 8.23';

str2 = 'r 24.4';

[letter1, rest] = strtok(str1);

num1 = str2num(rest);

[letter2, rest] = strtok(str2);

num2 = str2num(rest);

num1+num2

Cryptography, or encryption, is the process of converting plaintext 

(e.g., a sentence or paragraph), into something that should be 

unintelligible, called the ciphertext. The

reverse process is code-breaking, or cryptanalysis, which relies on 

searching the encrypted message for weaknesses and deciphering it 

from that point. Modern security systems are heavily reliant on these 

processes.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now