필터 지우기
필터 지우기

How to store a row value as an uint8 in a cell array?

조회 수: 2 (최근 30일)
Amit Bhasin
Amit Bhasin 2019년 1월 24일
댓글: Image Analyst 2019년 1월 25일
I am fetching the row values from an image but want to save all the different value in a cell array with different format. For example: how to store a row value from an image as an uint8 in a cell array?

답변 (1개)

Image Analyst
Image Analyst 2019년 1월 24일
That seems like a useless/bad/weird thing to do, but whatever, here is how to save row #37 to cell array "ca" in cell number 5:
ca{5} = uint8(grayImage(37, :));
I extracted row #37 of an image called "grayImage", all columns of that row, then cast it to uint8, and then assigned it as the contents (because I used curly braces) of cell #5 of a cell array called "ca".
Please read the FAQ to get a more intuitive feel for cell arrays and when to use parentheses or braces.
  댓글 수: 2
Amit Bhasin
Amit Bhasin 2019년 1월 24일
Thanks it helped!
Image Analyst
Image Analyst 2019년 1월 25일
You're welcome. Thanks in advance for "Accepting this Answer."

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

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by