필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Matrix Dimensions must agree

조회 수: 1 (최근 30일)
Alex
Alex 2011년 8월 16일
마감: MATLAB Answer Bot 2021년 8월 20일
With the following function, on the line fitted_Curve, there is the error that matrix dimensions must agree.
function f = functionToMinimise(x,Input,Actual_Output)
% f = x^2 %f and x are dummy variables
global c_x beta
Fitted_Curve = (1/(sqrt(x)*sqrt(beta)))*(c_x-asinh(sinh(c_x)*exp(x*Input*2*pi)))
What is wrong, and what to look for with this error message? Input is the vector, everything else is a coefficient.

답변 (1개)

the cyclist
the cyclist 2011년 8월 16일
I had to assume some things about calling your function, since you did not provide enough information to actually try to run your code. The following function (that calls your function) worked just fine:
function answerTest()
global c_x beta
c_x = 1;
beta = 1;
functionToMinimise(1,rand(1,3),1)
end
function f = functionToMinimise(x,Input,Actual_Output)
% f = x^2 %f and x are dummy variables
global c_x beta
Fitted_Curve = (1/(sqrt(x)*sqrt(beta)))*(c_x-asinh(sinh(c_x)*exp(x*Input*2*pi)));
f = Fitted_Curve;
end

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by