if i have number as index, and 300 character how i can find the chacter of these indexs

hello all; i have on e question which is: if i have to vectors, the first one it stored 300 English characters and the second for 20 index. how i can get character of those index .

 Accepted Answer

a='abcdefg'
id=[1 3 5]
out=a(id)

7 Comments

thank you abdelmalek, i applied your idea but i facing this error:
for ex_sec_out=1:length(Ex_distance)
for ex_sec_inn=1:length(Cover)
Ex_char_tem(ex_sec_inn,ex_sec_out)=Cover(Ex_distance(ex_sec_inn,ex_sec_out),ex_sec_out);
end
end
Index exceeds matrix dimensions.
Error in e_extructing (line 245) Ex_char_tem(ex_sec_inn,ex_sec_out)=Cover(Ex_distance(ex_sec_inn,ex_sec_out),ex_sec_out); >>
thank you Azzi Abdelmalek. my brother this is the example:
Cover={'In this study, capacity and security issues of text steganography have been considered to improve by proposing a novel approach. For this purpose, a text steganography method that employs data compression has been proposed. Because of using textual data in steganography, the employed data compression algorithm has to be lossless. Accordingly, LZW data compression algorithm has been chosen due to its frequent use in the literature and significant compression ratio. The proposed method constructs – uses stego keys and employs Combinatorics-based coding in order to increase security. Secret information has been hidden in the chosen text from the previously constructed text base that consists of naturally generated texts. Email has been chosen as communication channel between the two parties,s'}
Ex_distance=[72,73,127,136,160,174,175,229,230,238,239,240,241,247,249,291,292,655,672,706];
for ex_sec_out=1:length(Ex_distance)
for ex_sec_inn=1:length(Cover)
Ex_char_tem(ex_sec_inn,ex_sec_out)=Cover(Ex_distance(ex_sec_inn,ex_sec_out),ex_sec_out);
end
end
Index exceeds matrix dimensions.
Error in kuday (line 6) Ex_char_tem(ex_sec_inn,ex_sec_out)=Cover(Ex_distance(ex_sec_inn,ex_sec_out),ex_sec_out); >>
@abdulkarim hassan: the issue is not the indexing per se, but the fact that you have put the string inside of a (scalar) cell array. Note the difference:
a = 'abcdefg' % Azzi Abdelmalek's example
a = {'abcdefg'} % what you are doing is like this
Get rid of the cell array {} brackets , and the indexing should work. Although beginners seems to love them, there is no reason to stick all of your data inside cell arrays by default.
thank you Stephen, i employed your idea and i get the result. my question is how i can change this statement:
Cover={'In this study, capacity and security issues of text steganography have been considered to improve by proposing a novel approach. For this purpose, a text steganography method that employs data compression has been proposed. Because of using textual data in steganography, the employed data compression algorithm has to be lossless. Accordingly, LZW data compression algorithm has been chosen due to its frequent use in the literature and significant compression ratio. The proposed method constructs – uses stego keys and employs Combinatorics-based coding in order to increase security. Secret information has been hidden in the chosen text from the previously constructed text base that consists of naturally generated texts. Email has been chosen as communication channel between the two parties,s'}
into, using builtin function or converter.
Cover='In this study, capacity and security issues of text steganography have been considered to improve by proposing a novel approach. For this purpose, a text steganography method that employs data compression has been proposed. Because of using textual data in steganography, the employed data compression algorithm has to be lossless. Accordingly, LZW data compression algorithm has been chosen due to its frequent use in the literature and significant compression ratio. The proposed method constructs – uses stego keys and employs Combinatorics-based coding in order to increase security. Secret information has been hidden in the chosen text from the previously constructed text base that consists of naturally generated texts. Email has been chosen as communication channel between the two parties,s';

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!