Hi all,
Can anyone help me with this problem - Error using cos Not enough input arguments.
A2=sinh((x^2)+cos^2*y)^3/sqrt(abs(x-cos(y))+ln*(abs((x-cos(y)))/(x^2)+(cos^2)*y+abs(sin)*x))
Error using cos
Not enough input arguments.
i am new to matlab and i need to rezolve these expresition.

댓글 수: 1

Stephen23
Stephen23 2020년 9월 4일
편집: Stephen23 2020년 9월 4일
The function cos requires one input argument. As the error message states, you have called cos with no input argument, which throws an error. I have marked those locations for you, showing where you have called it incorrectly:
A2=(sinh((x^2)+(cos^2)*y)^3/sqrt(abs(x-cos(y)))+ln*(abs((x-cos(y))))/(x^2)+(cos^2)*y+abs(sin(y))*x)
% ^^^^ ^^^^
Your use of matrix operations is also quite likely to be incorrect:

댓글을 달려면 로그인하십시오.

 채택된 답변

Fangjun Jiang
Fangjun Jiang 2020년 9월 4일

0 개 추천

try this line by line
y=pi
(cos(y))^2
cos^2*y

댓글 수: 4

i don't understand because i am beginner in matlab,maybe help me with this code?
You need to provide the original math equation.
Cristian Rosca
Cristian Rosca 2020년 9월 4일
편집: Cristian Rosca 2020년 9월 4일
when x=-1.75*10^-3
y=3*pi
create some interim variables and build up your result
x=-1.75*10^-3;
y=3*pi;
cos_y=cos(y);
temp1=x^2+cos_y^2;
temp2=x-cos_y;
A2=sinh(temp1^3/sqrt(abs(temp2)))+log(abs(temp2/temp1))+abs(sin(y))*x

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Steven Lord
Steven Lord 2020년 9월 4일

0 개 추천

In mathematics we write but when we implement that in MATLAB we implement it as [not to be confused with .]
x = pi/4;
y = cos(x)
z = cos(x).^2 % compare to y^2
w = cos(x.^2)

댓글 수: 3

Cristian Rosca
Cristian Rosca 2020년 9월 4일
편집: Cristian Rosca 2020년 9월 4일
i don't understand because i am beginner in matlab,maybe help me with this code?
Run those four lines. See that z is the square of y. That is how you compute the square of the cosine of an angle. cos^2(x) is not valid MATLAB syntax.
anyway is incorrect:((

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

릴리스

R2016a

태그

질문:

2020년 9월 4일

댓글:

2020년 9월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by