1
下面是我的一個函數的代碼,如果anova1的p值爲< 0.05,則適合一系列的數據點。然而,儘管行數大小(y,1)等於組中的長度,但我仍然在MATLAB中看到「X和GROUP必須具有相同長度」的錯誤消息。這裏可能會出現什麼問題?anova1生成錯誤:MATLAB
function [a,b,c,d] = fit_arm_nerve(filename)
data = load(filename,'-ascii');
x = data(1,:);
y = data(2:end,:);
Num_Reps = size(y,1);
length(y)
G = [repmat(1:length(y),Num_Reps,1)];
length(G)
anova_p = anova1(y,G,'off');
if anova_p<0.05
[a,b,c,d] = gaussfit(x,y);
else
a = NaN;
b = NaN;
c = NaN;
d = NaN;
end
end
它會在gaussfit(x,y)中崩潰嗎? – farbiondriven
不,它甚至不會到達那裏,它停在anova1 –
爲了更好地理解你的問題,你可以在你的問題中增加一個最小的數據例子嗎? – Irreducible