Yuav ua li cas koj dim ib tug cim nyob rau hauv Matlab?
Yuav ua li cas koj dim ib tug cim nyob rau hauv Matlab?

Video: Yuav ua li cas koj dim ib tug cim nyob rau hauv Matlab?

Video: Yuav ua li cas koj dim ib tug cim nyob rau hauv Matlab?
Video: Yuav ua li cas thiaj khiav dim lub ntiajteb no 2024, Tej zaum
Anonim

Cov khiav tus cwj pwm hauv Matlab yog cov ib nqe lus ('), tsis yog backslash (), zoo li hauv C lus. Yog li, koj txoj hlua yuav tsum zoo li no: tStr = 'Hav, Kuv yog Loj (Tsis Loj) MATLAB neeg quav yeeb quav tshuaj; Txij li kuv hnub kawm ntawv! '

Ib yam li ntawd ib tug yuav nug, ua li cas koj khiav hauv Matlab?

Yuav tsum tso tseg kev tua a MATLAB ® hais kom ua, nias Ctrl + C los yog Ctrl + Break. Ntawm Apple Macintosh platforms, koj kuj tuaj yeem siv Command +. (lub Command key thiab lub sij hawm tseem ceeb). Ctrl + C tsis yog ib txwm tso tseg kev ua tiav rau cov ntaub ntawv uas siv sijhawm ntev, lossis hu ua built-ins lossis MEX-cov ntaub ntawv uas khiav ntev.

Tsis tas li ntawd, tus neeg teb xov tooj hauv Matlab yog dab tsi? Ib tus neeg ua haujlwm yog ib lub cim uas qhia lub compiler los ua ib qho kev ua lej lossis kev sib cav sib ceg. MATLAB yog tsim los ua haujlwm feem ntau ntawm tag nrho cov matrices thiab arrays. Yog li ntawd, MATLAB operators ua haujlwm ob qho tib si ntawm scalar thiab non-scalar cov ntaub ntawv. MATLAB tso cai rau cov nram qab no hom kev ua haujlwm theem pib -

Ua li no, yuav ua li cas kuv muab ib nqe lus hauv ib txoj hlua hauv Matlab?

  1. Cov hlua pib thiab xaus nrog ib qho lus hais (' = apostrophe). Ib daim ntawv qhia ob npaug (") txhawm rau txiav cov hlua ua rau muaj qhov yuam kev.
  2. Txhawm rau muab ib qho kev tsocai rau hauv ib txoj hlua siv ob qho tib si hauv kab ('). (tsis yog blackslash khiav)
  3. matlab tsis muaj hlua interpolation. Txhawm rau muab tus lej rau hauv txoj hlua, nws yog qhov zoo tshaj los siv sprintf().

Sprintf ua dab tsi hauv Matlab?

sprintf ua yog tib yam li fprintf tshwj tsis yog tias nws rov qab cov ntaub ntawv hauv a MATLAB string variable es tsis sau nws rau ib cov ntaub ntawv. Txoj hlua hom qhia cov cim, kev sib dhos, cov lej tseem ceeb, qhov dav dav, thiab lwm yam ntawm cov ntawv tso tawm.

Pom zoo: