Error using round every time can anyone please help me with this?

조회 수: 8 (최근 30일)
Raj Arora
Raj Arora 2021년 4월 20일
댓글: Raj Arora 2021년 4월 21일
c= 1;
n = 0.025;
bw = 36;
angle = 60;
syms x
tw = simplify(bw + 2*(x * tand(angle)));
A = 0.5*(bw + simplify(tw))*x;
P = simplify(bw + 4*x);
%%2* simplify(sqrt((x^2)+((x*tand(angle))^2)))
S = 0.00001;
Q = 347.9;
syms brand height
brand = ((c/n)*((A^1.666)/(P^0.666))*(S^0.5)) == Q
height = vpasolve(brand, x)
stage = round(height,4); %%%LINE 18%%
ITS SHOWING TOO MANY INPUT ARGUMENT WHY SO?
OUTPUT
Error using sym/round
Too many input arguments.
Error in Untitled2 (line 18)
stage = round(height,4)

채택된 답변

Star Strider
Star Strider 2021년 4월 20일
Convert ‘height’ to double first:
stage = round(double(height),4) %%%LINE 18%%
.
  댓글 수: 2
Raj Arora
Raj Arora 2021년 4월 20일
thanks start strider.
Star Strider
Star Strider 2021년 4월 20일
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

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

추가 답변 (1개)

Steven Lord
Steven Lord 2021년 4월 20일
The round function for symbolic expressions does not accept the input argument N (the number of digits to which to round) like the round function for numeric arrays does. If you convert your height variable to double then you can call round to round the number to 4 places.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by