• matlab制造一个64*64的仿真数据


    fid = fopen('test_001.img','w');
    r=random('Normal',100,0,64,64);
    z=random('Uniform',0,5,64,64);
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    a=14;
    b=16;
    for i=15:18
        for j=a:b
            r(i,j)=random('Normal',102,0,1,1);
        end
        a = a-1;
        b = b+1;
    end
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    for i=15:18
        for j=31:34
            r(i,j)=random('Normal',102,0,1,1);
        end
    end
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    for i=14:19
        for j=47:48
             r(i,j)=random('Normal',102,0,1,1);
        end
    end
    
    for i=16:17
        for j=45:50
            r(i,j)=random('Normal',102,0,1,1);
        end
    end
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    
    a=13;
    b=17;
    for i=30:35
        for j=a:b
           r(i,j)=random('Normal',102,0,1,1); 
        end
        
        a=a-1;
        b=b+1;
        
    end 
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    for i=30:35
        for j=30:35
            r(i,j)=random('Normal',102,0,1,1); 
        end    
    end
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    for i =29:35
        for j=47:49
             r(i,j)=random('Normal',102,0,1,1);
        end 
    end 
    
    for i=31:33
        for j=45:51
            r(i,j)=random('Normal',102,0,1,1);
        end
    end
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    
    a=13;
    b=18;
    for i=46:53
        for j=a:b
            r(i,j)=random('Normal',102,0,1,1);
        end
        a=a-1;
        b=b+1;
    end 
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    for i=45:53
        for j=29:37
            r(i,j)=random('Normal',102,0,1,1);
        end
    end
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    for i=44:53
        for j=46:49
            r(i,j)=random('Normal',102,0,1,1);
        end
    end 
    
    for i=47:50
       for j=43:52
            r(i,j)=random('Normal',102,0,1,1);
       end
    end 
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    r=r+z;count =fwrite(fid,r);
    fclose('all');




    fid = fopen('test_002.img','w');
    s=random('Normal',100,0,64,64);z=random('Uniform',0,5,64,64);
    for i=8:12
    for j=8:12
    s(i,j)=random('Normal',102,0,1,1);
    end
    end
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    s=s+z;count=fwrite(fid,s);
    fclose('all');

      

  • 相关阅读:
    如何更好的学习编译原理?
    组合数据类型练习
    简化版c语言文法
    Python基础练习
    Linux 命令
    实验一:词法分析实验报告
    20160930 词法分析程序
    大数据概述
    WP7应用开发笔记(7) 配置和存储
    欧拉计划 第九题
  • 原文地址:https://www.cnblogs.com/haore147/p/3796629.html
Copyright © 2020-2023  润新知