24小时热门版块排行榜    

查看: 1390  |  回复: 4

qdwang

木虫 (小有名气)

[交流] 【求助】matlab 算法求教

对一数组,其中的元素低于某一常数值a时,使其归0.使用哪什么语句啊。。。我是新人,谢谢。
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

change0618

铁杆木虫 (著名写手)

方丈大师


qdwang(金币+2):谢谢。 2010-10-19 20:16:32
ctgu_zheng(金币+1):欢迎常来交流 2010-10-21 22:53:24
>> a=1:8

a =

     1     2     3     4     5     6     7     8

>> a(a<4)=0

a =

     0     0     0     4     5     6     7     8
2楼2010-10-19 19:31:12
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

qdwang

木虫 (小有名气)

引用回帖:
Originally posted by change0618 at 2010-10-19 19:31:12:
>> a=1:8

a =

     1     2     3     4     5     6     7     8

>> a(a<4)=0

a =

     0     0     0     4     5     6     7     8

怎么让matlab一次读入多组mat型矩阵或数组啊。朋友。谢谢。
3楼2010-10-19 20:17:35
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

qdwang

木虫 (小有名气)

怎么让matlab一次读入多组mat型矩阵或数组啊。朋友。谢谢。
4楼2010-10-20 10:03:09
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

lidaxue

木虫 (正式写手)

之乎者也


nono2009(金币+1):鼓励应助 2010-10-30 06:50:16
qdwang(金币+3): 谢谢你的认真讲解 2011-04-26 09:13:26
引用回帖:
Originally posted by qdwang at 2010-10-20 10:03:09:
怎么让matlab一次读入多组mat型矩阵或数组啊。朋友。谢谢。

参见 matlab的 help read
++++++++
>> 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

>>
Comeon!
5楼2010-10-29 09:22:31
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 qdwang 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[博后之家] 售SCI一区T0P文章,我:8.O55.1.O.54,科目全,可十急 +4 vZfe6xYu34yj 2026-09-14 4/200 2026-09-16 22:40 by Tql5LQhh5rLK
[博后之家] 售SCI一区文章,我:8O5.5.1.O5.4,科目全,可伽急 +5 6F5UbRU2I5hL 2026-09-14 5/250 2026-09-16 20:38 by MHf40yA0Uhyb
[博后之家] 售SCI文章,我:8O5.5.1.O.54,科目齐全,可+急 +5 s3fFTmArrBt6 2026-09-14 7/350 2026-09-16 19:27 by rRvxEj3zorCy
[找工作] 售SCI一区T0P文章,我:8O.55.1.O.5.4,科目齐全,可+急 +3 s3fFTmArrBt6 2026-09-13 3/150 2026-09-16 18:39 by rRvxEj3zorCy
[考研] 售SCI一区文章,我:8.O.551.O.5.4,科目全,可伽急 +7 QUjhNVAcOSff 2026-09-13 8/400 2026-09-16 18:37 by rRvxEj3zorCy
[博后之家] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +8 QUjhNVAcOSff 2026-09-13 9/450 2026-09-16 18:36 by rRvxEj3zorCy
[公派出国] 售SCI一区T0P文章,我:8O.55.1.O.5.4,科目齐全,可+急 +3 6F5UbRU2I5hL 2026-09-14 3/150 2026-09-16 17:12 by i3KBRD19ERkG
[博后之家] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +4 6F5UbRU2I5hL 2026-09-14 4/200 2026-09-16 17:03 by i3KBRD19ERkG
[找工作] 售SCI一区T0P文章,我:8.O55.1.O.54,科目全,可十急 +3 s3fFTmArrBt6 2026-09-14 4/200 2026-09-16 16:51 by i3KBRD19ERkG
[找工作] 售SCI一区T0P文章,我:8.O.55.1.O.54,科目齐全,可+急 +3 Aj1rhIDL5ixY 2026-09-14 3/150 2026-09-16 07:12 by LH5NkK5Ud4bh
[硕博家园] 售一区SCI文章T0P,我:8O.551.O54,科目全,可十急 +3 0pYnUiPDfdnk 2026-09-14 3/150 2026-09-16 06:51 by LH5NkK5Ud4bh
[硕博家园] 售SCI一区T0P文章,我:8.O.55.1.O54,科目全,可伽急 +5 QUjhNVAcOSff 2026-09-13 5/250 2026-09-16 02:14 by DgNGHc3h5tPl
[考博] 申博发邮件 +4 Lmengk 2026-09-15 4/200 2026-09-16 00:05 by 木心想继续深造
[找工作] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +3 23jxep3nCNZb 2026-09-14 3/150 2026-09-15 18:47 by CgyNCDVNhGVg
[考博] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +3 6F5UbRU2I5hL 2026-09-14 3/150 2026-09-15 17:39 by CgyNCDVNhGVg
[硕博家园] 售SCI一区T0P文章,我:8.O.55.1.O54,科目全,可伽急 +3 23jxep3nCNZb 2026-09-14 3/150 2026-09-15 09:38 by VMDqgnlKimtZ
[公派出国] 售SCI文章,我:8O5.5.1.O.54,科目齐全,可+急 +3 6F5UbRU2I5hL 2026-09-14 3/150 2026-09-15 08:58 by C79jjtjAKjEn
[教师之家] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +3 LwdutQ8HoqWP 2026-09-13 4/200 2026-09-14 16:13 by Aj1rhIDL5ixY
[考博] 西北工业大学材料学院电化学传感与催化课题组招收2027年推免研究生、博士生、博士后 +3 马方园 2026-09-10 4/200 2026-09-14 09:29 by Chem张zz
[考博] 27秋季材料博士申请求助 10+3 Cahal1 2026-09-11 4/200 2026-09-14 08:50 by 北京莱茵编辑
信息提示
请填处理意见