What code can I use to get a signal from the image?

조회 수: 15 (최근 30일)
pantea sam
pantea sam 2022년 12월 27일
답변: Hiro Yoshino 2022년 12월 27일
Can I use another code besides this one?
YourSignal = original(:);
plot(YourSignal);

답변 (1개)

Hiro Yoshino
Hiro Yoshino 2022년 12월 27일
Taks this as an example.
im = imread("coins.png");
imshow(im);
if you want to convert the matrix into either row or column vector:
im_row = reshape(im,1,[])
im_row = 1×73800
49 47 48 48 48 48 48 51 50 51 50 47 49 50 50 50 49 49 49 51 50 51 51 49 49 50 51 50 51 50
im_col = reshape(im,[],1)
im_col = 73800×1
49 47 48 48 48 48 48 51 50 51
if you just swap the row and column (n x m >> m x n)
im_reshape = reshape(im,size(im,2),size(im,1));
imshow(im_reshape);
Note that the pixels are numbered from top to bottom and from left to right.

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by