24小时热门版块排行榜    

查看: 841  |  回复: 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 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考博] 大扩招 +13 version211 2024-05-21 19/950 2024-05-23 20:46 by keyaner23
[硕博家园] 又见奇葩学生,可咋办 +26 appleapple2 2024-05-17 31/1550 2024-05-23 18:34 by l12922927
[硕博家园] 又忍不住想吐槽文科的学术圈 +9 nvizqxuf 2024-05-18 11/550 2024-05-23 18:15 by zqwcr
[基金申请] 化学B口多少分能上会呀 +7 WOWO159357 2024-05-22 15/750 2024-05-23 17:25 by shuguang8600
[有机交流] TsCl保护羟基为什么不反应 +7 853015158 2024-05-21 25/1250 2024-05-23 17:19 by 853015158
[考博] 邀请申请深圳大学计算机与软件学院专业学位博士研究生(具身智能机器人方向) +3 Qiang_Li 2024-05-22 5/250 2024-05-23 14:28 by Qiang_Li
[论文投稿] Neurocomputing 外审结束 +5 mollyzhang_2003 2024-05-23 5/250 2024-05-23 12:03 by nono2009
[论文投稿] 因为邮箱故障,没有收到论文接受后进入生产的邮件 5+3 VCOISTNT 2024-05-22 5/250 2024-05-23 10:03 by bobvan
[硕博家园] 人生 +10 暮色恋伊人 2024-05-22 10/500 2024-05-23 08:33 by happy个
[教师之家] 来用亲身体会,一起说说年轻老师的辛苦 +20 zylfront 2024-05-17 26/1300 2024-05-23 07:53 by luwangba
[论文投稿] word转成pdf之后公式里面的字体变了,正文字体没变。 +9 1255037206 2024-05-20 11/550 2024-05-23 05:54 by tjushede
[论文投稿] 求推荐期刊 20+4 好困好困a 2024-05-18 5/250 2024-05-22 22:41 by 知识产权服务
[教师之家] 执念 +9 459582015 2024-05-16 10/500 2024-05-22 19:28 by 预演556
[考博] 换导师 +16 是柠檬呀! 2024-05-18 29/1450 2024-05-22 16:29 by oooooo?o
[硕博家园] 博士复试,申请成绩复核,有机会翻盘吗? +15 长海二声笑 2024-05-21 22/1100 2024-05-22 12:44 by 带甲三千
[复合材料] 关于导电胶 +3 wgx2000 2024-05-17 6/300 2024-05-22 09:42 by wgx2000
[基金申请] 太诡异了,五月底还有没有送审的。。 +12 hdzw9071 2024-05-21 12/600 2024-05-21 12:43 by dxcharlary
[基金申请] 这个模块怎么成了烧香拜佛的地方了 +7 shrz98 2024-05-18 7/350 2024-05-21 10:26 by lancet0903
[考博] 考博跨专业可以跨多远 +5 竹外。。。 2024-05-18 6/300 2024-05-19 21:51 by 摩天思瑞
[论文投稿] 推荐转投( transfer pending)是否有用? 50+3 lily5289 2024-05-17 7/350 2024-05-19 15:11 by wanghuawei
信息提示
请填处理意见