How to create a 3 variable Karnaugh Map

How to create a 3 variable karnaugh map.

回答 (1 件)

Devineni Aslesha
Devineni Aslesha 2020 年 1 月 14 日
編集済み: Devineni Aslesha 2020 年 1 月 17 日

0 投票

The following link might help in creating a 3 variable Karnaugh map in MATLAB.
To create a 3 variable Karnaugh map, the function mymap available in the above link can be modified as shown below.
if nargin == 0
map = zeros(2,4);
for i = 0:1
for j = 0:3
map(i+1,j+1) = str2num(mybin2dec([mydec2gray(num2str(i)) mydec2gray(num2str(j))]));
end
end
end

3 件のコメント

vedesh Mohit
vedesh Mohit 2020 年 1 月 24 日
編集済み: vedesh Mohit 2020 年 1 月 24 日
when i make these adjustments to the function mymap, I am getting an error of not enough input arguments in the solveKmap function. How do I go about fixing this?
Walter Roberson
Walter Roberson 2020 年 1 月 24 日
How are you invoking the function? Are you using the gui provided?
Devineni Aslesha
Devineni Aslesha 2020 年 1 月 24 日
Hi Mohit
The solveKmap function available in the file exchange is written for 4 variable Karnaugh map. You need to modify the code in the solveKmap function suitable to provide outputs for a 3 variable Karnaugh map.
Also, the error of not enough input arguments in the solveKmap function is due to the non provision of input while calling the function. The input to the solve Kmap function can be a 2 X 4 matrix as shown below.
kmap = [0 0 0 1; 0 0 1 1];

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeModeling についてさらに検索

タグ

質問済み:

2020 年 1 月 11 日

コメント済み:

2020 年 1 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by