我有一個可用的matlab/octave m文件,但是當我將M文件轉換爲函數並運行它時,出現函數說'函數名'未定義在第7行第16列附近。在matlab中的permute函數/ octave
見下workng M檔:
clear all, clc,clf,tic
fs=360;
t=linspace(0,2*pi,fs);
y=sinc(t*1);
sigarray=y;
fs=length(sigarray);
aa_sig_combined_L=zeros(1,length(fs)); %need to reset or will get noise at the end
a_L=zeros(1,length(sigarray));
cycle_permute_lt = @(sigarray, k) [sigarray(mod((1:end)+k-1, end)+1)];
array_phase_shift_div_num=360/mod(180,360) %keep at 360 to get correct deg angles
array_phase_shift=round(fs/array_phase_shift_div_num) %will keep within 360 degs
for ii=0:1:fs
a_L=cycle_permute_lt(sigarray, ii+array_phase_shift);
aa_sig_combined_L = aa_sig_combined_L + a_L;
end;
array_shifted=aa_sig_combined_L;
subplot(2,1,1),plot(t,y),
title('original')
subplot(2,1,2),plot(t,aa_sig_combined_L)
str_title='aa_sig_combined_L';
title(str_title,'Interpreter','none') %turns of latex interperter so I can use underscores my way
見M檔及以下創建不起作用低於
clear all, clc,clf,tic
fs=360;
t=linspace(0,2*pi,fs);
y=sinc(t*1);
sigarray=y;
[array_shifted]=rtpsa(y,180)
功能訪問時功能:
我使用倍頻版本3.2.4和Ubuntu Linux的10.04
也許你應該這篇文章的標題更改爲octave'未定義'「函數名稱」作爲這個問題的本質無關與置換功能。 – zeffii 2012-11-09 18:03:39