I have a code in which after the processing a numeric expression is stored in a variable 'Final'
and the numeric expression is (3206987*2^(3/10)*3^(29/40)*5^(23/40))/12000000
but when I do, disp(Final) it shows the entire numeric expression "(3206987*2^(3/10)*3^(29/40)*5^(23/40))/12000000" instead of solving this and printing out "1.841"
How do I get matlab to print out the solved solution instead of the numeric expression?

댓글 수: 1

% This is the code, Normally "S" will be an input function.
close all
clc
clear
syms w h
S = 0.1901*(w^(0.425))*(h^0.725);
Dsw = diff(S, w);
Dsh = diff(S, h);
first_term = Dsw*10;
second_term = Dsh*2.3;
Final1 = subs(first_term + second_term, w, 100);
Final = subs(Final1, h, 60);
disp(simplify(Final))

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

 채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 12월 27일
편집: KALYAN ACHARJYA 2020년 12월 27일

0 개 추천

disp(vpa(simplify(Final)))
Or
fprintf('%.3f',simplify(Final))

추가 답변 (0개)

카테고리

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

제품

릴리스

R2020b

질문:

2020년 12월 27일

편집:

2020년 12월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by