这是什么语言?

时间:2011-10-06 18:38:19

标签: shell

源文件名为“ReadOutputFile.m”。

function ReadOutputFile(inputFile, outputFile)

SPIT = 2;
R_REGULARITY = 8;

%read input, threshold, and level
spitclip = wavread(inputFile);
spitclip = spitclip*(2^15);

fid = fopen('threshBinary.bin', 'rb', 'native');
thresh = fread(fid, 'int16');
fclose(fid);

fid = fopen('signalLevelBinary.bin', 'rb', 'native');
lvl = fread(fid, 'int16');
fclose(fid);


%get start and stop information from output file
outputNumeric = csvread(outputFile);

starts = outputNumeric(:,1);
stops = outputNumeric(:,2);
types = outputNumeric(:,8);
reasons = outputNumeric(:,9);
regularity = outputNumeric(:,7);

indicesOfSpits = find(types==SPIT);

numEvents = length(starts);

eventGate = zeros(1,length(spitclip));
firstSpits = zeros(1,length(spitclip));
chainedSpits = zeros(1,length(spitclip));

maxVal = 800;

%loop through events and plot spits only
%color code by reason
for n = 1:length(indicesOfSpits)
    i = indicesOfSpits(n);

    if(reasons(i) == R_REGULARITY)
        chainedSpits(starts(i):stops(i)) =  regularity(i)*800;
    else
        firstSpits(starts(i):stops(i)) =  maxVal;
    end
end

plot(spitclip);
hold on;
grid on;
plot(lvl,'r');
plot(thresh, 'y');
plot(firstSpits, 'm');
plot(chainedSpits, 'k');

2 个答案:

答案 0 :(得分:3)

看起来像Matlab(或自由的等效八度)

答案 1 :(得分:0)

http://en.wikipedia.org/wiki/M_(programming_language)

你会想,找到编程语言是多么容易。 只知道后缀。