How to convert array of data to images

3 ビュー (過去 30 日間)
Ambali Odebowale
Ambali Odebowale 2022 年 10 月 8 日
回答済み: Image Analyst 2022 年 10 月 8 日
I have a file containing 500 by 20000 data points. I want to convert the data to images. Here is the code I used but I am getting error
s = load('Absorptiondata8.mat');
yo = s.Absorptiondata8;
columns = max(yo);
row = length(yo);
outputImage = false(row);
for k = 1 : row
outputImage(yo(k)) = true;
end
imshow(outputImage);

採用された回答

Image Analyst
Image Analyst 2022 年 10 月 8 日
This is just a set of 6 small numbers - not a complete image where every pixel has an intensity value.
data = readmatrix('ab.txt')
data = 5×2
0.0000 0.0102 0.0000 -0.0066 0.0000 0.3177 0.0000 0.3639 0.0000 0.3138
x = data(:, 1);
y = data(:, 2);
plot(x, y, 'b.-', 'LineWidth', 2, 'MarkerSize', 40)
grid on;
Exactly how would you like to make those 6 (x,y) coordinates into an image? Would you like to use poly2mask, or perhaps exportgraphics???

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by