2-1 使用變數?基???

MATLAB {Ѥ@`Ψ쪺[]+^B]-^B]*^B]/^B]^^ƾǹBŸA]b MATLAB Ui򥻹BAֳ̧t²檺覡Ob W@`йL@w MATLAB RO]Command Window^ܲŸ]>>^JB⦡AëJ Enter YiCҦpG

>> (5*2+3.5)/5 ans = 2.7000

MATLAB |NB⵲GsJw]ܼ ansAN MATLAB B᪺ס]Answer^AæbùWܨB⵲Gƭȡ]bWҤAY 2.7000^C

Hint
bѤA">>" N MATLAB ROܲŸ]Command Prompt^AϥΪ̥iHb᭱J MATLAB ykB⦡AHiBzC

YQ MATLAB CܹB⵲GAuݦbB⦡̫[W];^YiAҦpG

>> (5*2+3.5)/5;

bWҤAѩB⦡᭱[JA] MATLAB u|NB⵲Gxsbw]ܼ ans A|ܩùWFYݭnΩܦB⵲GAiJܼ ans YiAҦpG

>> ans ans = 2.7000 ϥΪ̤]iNB⵲GxsϥΪ̦ۤv]wܼ x AҦpG >> x = (5*2+3.5)/5 x = 2.7000

Hint
  • Ĥ@ӦrݬO^rC
  • ridŮC
  • ̦hu঳ 31 ӦrAMATLAB |hlr]b MATLAB 4 AhO 19 Ӧr^C
  • MATLAB bϥܼƮɡAݹwgLܼƫŧi]Variable Declaration^{ǡAӥBҦƭܼƧHw] double ƫxsC

Yn[Jѡ]Comments^AiHϥΦʤŸ]%^AMATLAB |NҦbʤŸ᪺r{ѡAҦpG

>> y = (5*2+3.5)/5; % NB⵲Gxsbܼ yAܩù >> z = y^2 % NB⵲Gxsbܼ zAܩù z = 7.2900

bWҤAʤŸ᪺rOѡA|Q MATLAB ӤAOѪϥΥi MATLAB {iŪʡC

MATLAB iPɰHr],^Τ];^j}ƭӹB⦡AҦpG

>> x = sin(pi/3); y = x^2; z = y*10 z = 7.5000

Y@ӼƾǹBOӪAiΤTӥyI]K^N䩵U@AҦpG

>> z = 10*sin(pi/3)*... >> sin(pi/3);
MATLAB{]pGJg