I have an array and I'd like to sum up very specific data. Background info, the array is an image and I would like to display an image which is a summation of a few frames
my data is stored like such:
a = data{1}(:,:,1,:15) % This displays the first image in the 15th frame.
imagesc(1)
I would like to display the first image with a summation of the first to fourth frame but when I try I get errors
example:
sum(data{1}(:,:,1,1:4)); imagesc(a)
the error obtained is:
Error using image Indexed CData must be size [MxN], TrueColor CData must be size [MxNx3]
Error in imagesc (line 19) hh = image(varargin{1},'CDataMapping','scaled');
Error in Summation (line 5) imagesc(a)
What does this mean, and how can I fix it !?

 채택된 답변

Matt J
Matt J 2013년 7월 11일

0 개 추천

sum(data{1}(:,:,1,1:4) ,4 );

댓글 수: 3

Hanif
Hanif 2013년 7월 11일
What purpose the the , 4 have? Please explain! Thank you!
Matt J
Matt J 2013년 7월 11일
You're summing along the 4th dimension of your frame data.
Hanif
Hanif 2013년 7월 11일
Thank you!

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

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Images에 대해 자세히 알아보기

질문:

2013년 7월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by