trying to Create output for the command window using fprintf " using matlab 2018b"
x = 2;
y = 4;
z = 7;
h = 9;
sol1 = x + h
sol2 = z/h
sol3 = y*cos(z)
sol4 = sqrt(h)*(z)^2
sol5 = abs(-x)/log(y)
fprintf('%s%4i\n',' Addition: ',A)
fprintf( )

댓글 수: 2

Walter Roberson
Walter Roberson 2019년 1월 27일
I don't see an assignment to a variable A and if it is intended to be a function with no inputs, it would sure help to see the code for it...

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

답변 (1개)

madhan ravi
madhan ravi 2019년 1월 28일

0 개 추천

A=[1:5;[sol1 sol2 sol3 sol4 sol5]];
fprintf('Solution %d: %.2f\n',A)

카테고리

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

제품

릴리스

R2018b

태그

질문:

2019년 1월 27일

댓글:

2019년 1월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by