24小时热门版块排行榜    

查看: 848  |  回复: 4

qdwang

木虫 (小有名气)

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

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

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

source

» 猜你喜欢

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

已阅   回复此楼   关注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 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 面青地会评时间 +6 tanjydd 2024-06-15 6/300 2024-06-16 15:42 by 我是王小帅
[基金申请] 希望今年自己国自然面上项目和老婆青年项目能中! +7 恐龙爸爸 2024-06-14 7/350 2024-06-16 14:48 by redfish105
[基金申请] 博后基金,博管会会提前知道消息吗? +4 yuyiang 2024-06-13 4/200 2024-06-16 11:40 by yangyuzhong4
[基金申请] 博士后创新人才支持计划公示 +9 aishida144 2024-06-14 15/750 2024-06-16 09:52 by msjy
[有机交流] 车间生产,真空度很高,温度很高,但减压蒸馏速度很慢。 10+12 召唤鬼泣lL 2024-06-13 36/1800 2024-06-16 09:20 by ddc805
[找工作] 应届大龄土博教职选择,石河子大学和广西大学 10+4 茅山老道士 2024-06-10 33/1650 2024-06-16 08:36 by shl2112501
[论文投稿] 投稿被一个审稿人恶意评审了怎么样? +5 1chen 2024-06-14 7/350 2024-06-15 23:15 by xy66xy
[文学芳草园] 累并快乐着 +13 MYHLD521 2024-06-14 13/650 2024-06-15 22:59 by zeolitess
[基金申请] Nature 11日发文,中国著名学者们称造假迫不得已 +5 babu2015 2024-06-14 5/250 2024-06-15 20:40 by lc231001
[教师之家] 饶议:什么制度能保障大学普通教师不用为领导拎包,不用看领导脸色 +8 zju2000 2024-06-12 14/700 2024-06-15 13:59 by chemhua
[食品] 食品博士导师 +6 小李醒yy 2024-06-11 9/450 2024-06-14 23:37 by 小李醒yy
[基金申请] 博士后基金需要结题吗? +8 zhouchuck 2024-06-13 8/400 2024-06-14 17:27 by liuyupu132
[基金申请] E12面上申请 +4 汉风之遗 2024-06-13 4/200 2024-06-14 15:28 by 天外飞去来
[有机交流] ππ堆积会发生在有机溶剂中吗 5+3 zibuyu0420 2024-06-13 4/200 2024-06-14 14:17 by 小肉干
[论文投稿] 投稿后发现其他作者的邮箱填错了该怎么办呀 10+4 在飞的猪 2024-06-13 6/300 2024-06-14 04:45 by 小虫子咔咔
[有机交流] 旋蒸请教 +6 办公室摸鱼 2024-06-09 9/450 2024-06-13 21:31 by wuxiaominggo
[有机交流] 原料反应完了,怎么知道是产物还是中间体 +6 小胡在努力 2024-06-11 8/400 2024-06-13 13:33 by 091602
[论文投稿] with editor日期变更 +3 慎独的小花卷 2024-06-12 8/400 2024-06-13 11:00 by 慎独的小花卷
[基金申请] 博后特助这周出结果吗?往年都是啥时候啊? +13 jsqy 2024-06-12 17/850 2024-06-12 19:55 by Lynn212
[教师之家] 公办双非,学生论文升学就业都不行。一本大学的论文升学就业没问题吧? +5 河西夜郎 2024-06-09 5/250 2024-06-10 17:59 by yyallen2003
信息提示
请填处理意见