フィルターのクリア

Pass data type to function.

1 回表示 (過去 30 日間)
Tejasvee Bisen
Tejasvee Bisen 2021 年 1 月 30 日
回答済み: Walter Roberson 2021 年 1 月 30 日
I have an image, i have read it and want to pass the image data type "unit 8" to function, which is used in case statment.
while printing the 'origClass' it contains the char and i have to pass the 'unit8', which is data type of the read image.
buf = hTile.buf;
[tile_size_y, tile_size_x, numComponents] = size(buf);
origClass = class(buf);
switch origClass
case {'unit8'}
inputRGB = zeros(tile_size_y, tile_size_x, numComponents, 'int8');
case {'uint16'}
inputRGB = zeros(tile_size_y, tile_size_x, numComponents, 'int16');
case {'uint32', 'single'}
inputRGB = zeros(tile_size_y, tile_size_x, numComponents, 'int32');
end

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 1 月 30 日
unit8
uint8
Notice the spelling

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by