필터 지우기
필터 지우기

How to make array in matlab ( how to inisialisasi array )

조회 수: 1 (최근 30일)
Megah Putri
Megah Putri 2011년 8월 4일
how to use array in matlab

채택된 답변

Oleg Komarov
Oleg Komarov 2011년 8월 4일
Preallocation of an array is usually done with the zeros function:
B = zeros(n)
B = zeros(m,n)
B = zeros([m n])
B = zeros(m,n,p,...)
B = zeros([m n p ...])
where m,n,p,... express the size for the 1st,2nd,3rd,...nth dimension.
If you're not looking for preallocation then your answer is too generic.
Something else I can think of is a generation of a random matrix, see rand and related functions.
All of the basic are well covered, wiht many examples in the getting started guide
EDIT
obj=VideoReader(video);
% (start)
%akhir deklarasi gambar yang ada di axes
numFrames = obj.NumberOfFrames;
waktu = obj.Duration;
iterasi = numFrames/waktu;
vidHeight = obj.Height;
vidWidth = obj.Width;
disp(numFrames);
a = length(numFrames);
frames = zeros(vidHeight,vidWidth,iterasi);
c = 0;
if(~isempty(get(handles.nmvideo,'String')))
try
for n = 1:iterasi:numFrames
c = c+1;
frames(:,:,c) = read(obj,n);
h = axes(handles.axes1);
imshow(frames(:,:,c));
end
catch
msgbox('Codec AVI tidak didukung atau Corupted file AVI','Error','error');
return
end
else
msgbox('Anda harus memilih video terlebih dahulu','Error','error');
end
  댓글 수: 10
Megah Putri
Megah Putri 2011년 8월 4일
hhhhhmmmmmmmmmmmm...............
Walter Roberson
Walter Roberson 2011년 8월 4일
Yes, frames is a variable.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by