?? getpoly.m
字號:
function [array,ikey] = getpoly(string)
%GETPOLY is a MATLAB function which can be used to accept the
% polynominal set in the 's' array which may contain
% brackets. IF IKEY=0, then aborted return is made and
% there exists errors in the array representation.
% Author: Ole Barup Sorensen, Rapid Data Ltd
% Copyright (c) 1989-94 by Rapid Data Ltd
% Revision 10:32 07/02/94
mv = find(string ~= ' ');
string = string(mv);
ikey = 0; nLen = length(string); array = 1;
ii = find(string=='('); ij = find(string==')');
if length(ii)~=length(ij),
disp('( and ) mismatching');
else, ii = [ii length(string)+1];
if (ii(1)~=1),
[array,ikey] = polyevl(string(1:ii(1)-1));
end
for i=1:length(ii)-1,
[array1,ikey] = polyevl(string(ii(i)+1:ij(i)-1));
if i~=length(ii),
if (ii(i+1)-1~=ij(i)),
k0 = str2num(string(ij(i)+1:ii(i+1)-1));
if length(k0)==0,
disp(['Error in sub-string ' ...
string(ij(i)+1:ii(i+1)-1)]); return;
end
else
k0 = 1;
end
for j=1:k0
array = conv(array,array1);
end
end
end
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -