展会信息港展会大全

【求助】matlab 算法求教
来源:互联网   发布日期:2011-08-29 22:17:23   浏览:9417次  

导读:对一数组,其中的元素低于某一常数值a时,使其归0.使用哪什么语句...

change0618 (站内联系TA)

>> a=1:8

a =

     1     2     3     4     5     6     7     8

>> a(a> a=1:8

a =

     1     2     3     4     5     6     7     8

>> a(a> help read
--- help for mmreader/read ---

READ Read a multimedia file.

    VIDEO = READ(OBJ) reads in video frames from the associated file.  VIDEO
    is an H x W x B x F matrix where H is the image frame height, W is the
    image frame width, B is the number of bands in the image (e.g. 3 for RGB),
    and F is the number of frames read in.  The default behavior is to read in
    all frames unless an index is specified.  The type of data returned is
    always UINT8 data representing RGB24 video frames.

    VIDEO = READ(...,INDEX) performs the same operation, but reads only the
    frame(s) specified by INDEX, where the first frame number is 1.  INDEX can
    be a single index,  or a two-element array representing an index range
    of the video stream.

    For example:

       VIDEO = READ(OBJ);           % Read in all video frames.
       VIDEO = READ(OBJ, 1);        % Read only the first frame.
       VIDEO = READ(OBJ, [1 10]);   % Read the first 10 frames.

    If any invalid INDEX is specified, MATLAB throws an error.

    Example:
       % Construct a multimedia reader object associated with file 'xylophone.mpg' with
       % user tag set to 'myreader1'.
       readerobj = mmreader('xylophone.mpg', 'tag', 'myreader1');

       % Read in all video frames.
       vidFrames = read(readerobj);

       % Get the number of frames.
       numFrames = get(readerobj, 'numberOfFrames');

       % Create a MATLAB movie struct from the video frames.
       for k = 1 : numFrames
             mov(k).cdata = vidFrames(:,:,:,k);
             mov(k).colormap = [];
       end

       % Create a figure
       hf = figure;
      
       % Resize figure based on the video's width and height
       set(hf, 'position', [150 150 readerobj.Width readerobj.Height])

       % Playback movie once at the video's frame rate
       movie(hf, mov, 1, readerobj.FrameRate);

    See also audiovideo, movie, mmreader, mmreader/get, mmreader/set, mmfileinfo.

    Overloaded methods:
       vdspdebug/read
       eclipseide/read
       ghsmulti/read
       daitem/read
       dagroup/read
       rfckt.read
       vrjoystick/read
       ccsdebug/read
       wptree/read
       wdectree/read
       dtree/read

    Reference page in Help browser
       doc mmreader/read

>>

赞助本站

人工智能实验室
AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港