24小时热门版块排行榜    

查看: 852  |  回复: 4
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

qdwang

木虫 (小有名气)

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

对一数组,其中的元素低于某一常数值a时,使其归0.使用哪什么语句啊。。。我是新人,谢谢。
回复此楼

» 收录本帖的淘贴专辑推荐

source

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注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的回帖
查看全部 5 个回答

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

木虫 (小有名气)

怎么让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的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[硕博家园] 难道我真的要放弃吗? +11 133456 2024-06-20 11/550 2024-06-21 06:48 by 夜雪千寒
[硕博家园] 怎么带研究生? +11 豆豆小小2 2024-06-20 11/550 2024-06-21 00:18 by smilerobin
[考博] 有机化学迷茫学生 +4 佛系摸鱼5 2024-06-18 7/350 2024-06-20 23:56 by 佛系摸鱼5
[精细化工] 试剂价格 +7 旭必上岸 2024-06-17 10/500 2024-06-20 23:35 by 相与处于陆的鱼
[基金申请] 国自然青年基金,1A4B能上会吗?青年和面上的上会标准是一样的吗? +6 今晚推荐22 2024-06-20 9/450 2024-06-20 23:03 by 今晚推荐22
[考博] 一名额难求啊 +8 pinbo拼搏 2024-06-19 8/400 2024-06-20 22:37 by mch20120521
[找工作] 初始合伙人来啦!(生物试剂耗材标准品) +16 欢快的小科研人 2024-06-15 27/1350 2024-06-20 22:19 by zzw1992127
[找工作] 药学硕士找不到工作,打算去做科研助理了 +11 pom戴墨镜 2024-06-14 24/1200 2024-06-20 21:59 by 海阔天空4924
[基金申请] 国产期刊影响因子大于12的有20多个个了 +7 babu2015 2024-06-20 7/350 2024-06-20 21:39 by 潇湘之迷
[论文投稿] 第一篇论文投稿进程记录 +4 慎独的小花卷 2024-06-20 9/450 2024-06-20 20:37 by 慎独的小花卷
[有机交流] 求助 10+5 脂质纳米粒 2024-06-20 6/300 2024-06-20 17:16 by czyzsu
[教师之家] 试用期辞职 +10 ZHONGWU_U 2024-06-18 17/850 2024-06-20 17:07 by ZHONGWU_U
[有机交流] 怎么萃取出锡盐内包裹的化合物 +3 硕六过 2024-06-19 4/200 2024-06-20 15:45 by 2461777831
[教师之家] 每次骚扰女学生的都是院系领导,而不是普通教师,小编们要注意措辞正确 +11 zju2000 2024-06-15 13/650 2024-06-20 15:19 by ase123456
[考博] 这个博士要读吗 +15 Sea Breeze 2024-06-16 29/1450 2024-06-20 14:30 by Sea Breeze
[精细化工] 切削液交流群 +5 SZ吴彦祖 2024-06-17 5/250 2024-06-20 12:10 by 毛爱波BBB
[考博] 2025年博士申请,可先做科研助理 +4 limit888 2024-06-18 7/350 2024-06-20 10:23 by 安塔瓦拉多
[基金申请] 太卷了 +14 laoyuefubio 2024-06-17 27/1350 2024-06-20 09:52 by htjwqy
[催化] 镍负载氧化铝的保存问题 8+3 lwn0130 2024-06-15 6/300 2024-06-20 09:00 by lwn0130
[基金申请] F口信息学部拿面上,大概需要什么样的成果 +7 _奋黎_ 2024-06-16 18/900 2024-06-19 20:02 by _奋黎_
信息提示
请填处理意见