how i can i compute probabalties to compress all letters small capital and numbers

댓글 수: 3

With huffmandict()
Yusuf lamah
Yusuf lamah 2020년 2월 8일
how i can compute P in this dict = huffmandict(symbols,p); to compresss text contain letters capital, small and numbers
You are right, my response of huffmandict() was not correct.

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2020년 2월 8일

0 개 추천

[unique_symbols, ~, bin_number] = unique(YourText(:));
symbol_counts = accumarray(bin_number, 1);
symbol_probs = symbol_counts ./ numel(YourText);
Alternately,
sparse_count = sparse(1, double(YourText(:)), 1);
[~, unique_symbols, symbol_counts] = find(sparse_count);
unique_symbols = char(unique_symbols.');
symbol_probs = symbol_counts.' ./ numel(YourText);
In both cases, after the code, unique_symbols will be a column vector of characters that exist in the text, and symbol_probs will be the corresponding probability.
The sparse() version has a minor flaw that it will fail if any characters in the text are binary 0.

추가 답변 (3개)

Yusuf lamah
Yusuf lamah 2020년 2월 8일

0 개 추천

thank you very much for your reply but i need to know how compute the probabaleties as input of dict

댓글 수: 2

Are you certain that this remark about needing to know how to compute the probabilities is the answer that you needed to your question? You Accepted it ?
Yusuf lamah
Yusuf lamah 2020년 2월 10일
yes,thank you very much its working

댓글을 달려면 로그인하십시오.

Yusuf lamah
Yusuf lamah 2020년 2월 8일

0 개 추천

this function to compute dict i need to compute probabelties
Yusuf lamah
Yusuf lamah 2020년 2월 10일

0 개 추천

how to hide text in an image using LSB technique

댓글 수: 1

That is not a continuation of this question.
You should first use Google Scholar to research the topic.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품

릴리스

R2016a

태그

질문:

2020년 2월 7일

댓글:

2020년 2월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by