ࡱ> CFBvw7 bjbjUU 7|7|lFFFFFFFZ{? ? ZY:>((< ~ \.999999$; =9FHHH9FF:HFFJ 4H~ ( FF( ? dZ( J ):0Y:( >>< ZZFFFFProblem 2: t=0:0.0005:0.001; xactual=sin(2*pi*2000*t); ts=0:0.0001:0.001; xs=sin(2*pi*2000*ts); subplot(3,1,1);plot(t,xactual);stairs(ts,xs); title('Step Interpolation'); subplot(3,1,2);plot(t,xactual,ts+0.0001,xs); title('Linear Interpolation'); ysinc=rcosflt(xs,10000,4*10000,'normal',0); yrcos=rcosflt(xs,10000,4*10000,'normal',0.5); ti=0:0.000025:0.000025*[length(ysinc)-1]; subplot(3,1,3);plot(t,xactual,ti,yrcos); title('Raised Cosine Interpolation')     jU0J 5>*\  89Lbc&T~/ =!"#$%7 bjbjUU 7|7|l>>S?S?S?S?S?g?g?s?{?{? ? g? @>???????????????$^A ~C?S???????Dd-!0  # A2e@2LglADv`!9@2Lglk@x\lu7g"%ʾXC𭢣DxHZy[2ukw';nM46zr[Avص#wZ[WWz<%9o=r]U_ǧ/>_K>03WUH>Ab K,_ߟ(KxQmw/^F-z2JxD6˼3(۾-3…j[/)O^R'/) uc>mӄVm;(s>|UB`cpO!Kp!`<-;y Im:/>b߶{sJ2 /8Xn5#D4NbDy'Ē2o1KzmI^>P9>I.UUFZ싲ylK[-doD7 ):1~D.0muYp!,c8b@<(6CafSqfLQsQxݓvKvO^ /Ԗ>~oA<&KK'/MjK{wQ yF/[&eKn7m2!~X!̗ʒC|;~o<9)NJlckNXIN~n!C:IK2gx !zS5= >Kʫ(PFx X{]CxnC p ltb>fLΩnp/eav ~vbN|Q&El(*7 |k'MFZfrfsY2d-9-~s%tUOyf%[+[Yyxnr'M&x,&dΓ$g$Ipp.ǚ6\dpddɓ%ɒ q-W ZND]kbr".NDRNTfriON҄''iI@N3Nĕo{r'-=9NN~WqOX8Qm˞< e eOʄ (zâoVW</ʉ*G8F-^Dq?㜨6N\jƓ $c$IppIJE '*89Tyiqĵ+~s?BlQN8qO[8Wk^y/WxZx(xrQ \,\<(. +$EK~~ 6'ㄇq <-<I~h5YOlkJwM_ٟ8+`Y(gYYHJY6'=哿}Exf#B/@ /%q +ǯsQ2(/ʦuϳwmOp+go`K{PF7p!7a' w> ,<p=X~=2EA1 x_ƿiWWPgK (p +4"A/CQ:} Q2(22r?2zaʲ0 jPm0_ яlr3;NSJXcܢf ^Y'wj`[ۃOuĻ[yg5߃T`ώyQ!՟-%R +~&᪜ LpX[_kHm%<ڕ '9ĝrOMWZ캵6KQeD$FyZ4쬍Fc o$*JŮq,PG5YX9C#5ZIC#)5(1%5:dž/ e> Ɨ`>o"Zɿcsmۜۜslsؔ%vUVjp%[\h!FHjKP4G Dsq1h43N43CSh4܅Gtpƥ44ZS4ͤͤfRt4Lj4oi4i).7g:-ʖͭy]}y_љ(_30LrzQ {ч-ֵk6D4j ՈFF D+kQxjxRƓrIxR)ܑ>45i8:8: G;JXY+-֧ac}fY-&cnڝU 9.07qw6Z Y?DaM7x" G}'ba6mOfTӧN3'O4.zVXuޱS{ƿjo#:-yG%WJW}\2jl9 !Jk5fss< u&7(S45OSx.8">.4 f(4.Y%f7P4e9ьh41'1͘Fs.5샲M@ShN4eMYYY[D=܅GѨQ4fYTC.Qss ]=ۥْs=5fY=< yNYqv+o+}\HtTxZiC}0aj*x\qQǩNDv݉@Ԯ=4N8ɉӤ494x4Fd@e缽lD:2\vz.X#Nu"%MIq'%MIũJ8>H[NHE/㩻۫G51:[ el 1|bHUVDw#w",FYz]gkjVY1cVnj`s+Z#F ",OxrN<9ONy̷ Eh 4K͒͒fIgH+J^1Wg15vrW'nk$ kj{#kj#1g%6/͌9d#gתgi`㫿~@> Heading 2x5CJOJQJkH<A@< Default Paragraph Font"O" NoGraphB*0O0 Input5B* CJOJQJkH0O0 OutputB*CJOJQJkH0O!0 Error5B*CJOJQJkH6O16 AutoInit5B* CJOJQJkH.OA. Calc<B*CJOJQJkH 89Lbc&T~0000000000000000000INPUT_1OUTPUT_1 %9;LN]_w&+,3TVsx %9;LNcj&+TV~3333333333333 Kats Tanaka%D:\Program Files\Template\M-BOOK~.dot Kats Tanaka$D:\Program Files\Template\M-BOOK.dot Kats Tanaka$D:\Program Files\Template\M-BOOK.dot Jason Kinchen'C:\TEMP\AutoRecovery save of m-book.asd Jason Kinchen-D:\Applications\MSOffice\Templates\m-book.dot Ben Hinkle%D:\Work\Matlab\notebook\pc\M-BOOK.DOTecetJC:\WINDOWS\Application Data\Microsoft\Word\AutoRecovery save of m-book.asdecet.\\ECET_SRVR\annis\public_html\DSP\problem2.dotecetLC:\WINDOWS\Application Data\Microsoft\Word\AutoRecovery save of problem2.asdecet.\\ECET_SRVR\annis\public_html\DSP\problem2.dot  @AskedForShutdown`4InputCellCount(MATLABFig16Color MATLABFigEmbedMATLABFigUnits$ MATLABFmt8MATLABFmtStyleHyes1YESYESInchesShortLoose p5+ DGLM PR U eV  V  V  V  V  V  V  V~  V}  V |  V {  V z  V y  V x  Vw  V  Vv  Vu  Vt  Vs  Vr  Vq  Vp  Vo  Vj    D("TemplateProject.mwNewNotebook.MAINmw New NotebookmwNewNotebook.MAIN ( New &M-bookmw New NotebookmwNewNotebook.MAIN@ About MATLAB No&tebookmw Notebook Help AboutmwNotebookHelpAbout.MAIN@I   &Notebook &Notebook Evaluate &Cellsmw Matlab EvalmwMatlabEval.MAIN Evaluate Calc &Zonemw Matlab Recalc ZonemwMatlabRecalcZone.MAIN Evaluate &M-Bookmw Matlab RecalcmwMatlabRecalc.MAIN &Purge Output Cellsmw Matlab Purge OutputmwMatlabPurgeOutput.MAINi ?(Dt)+ 0ImI* &Notebook &Notebook444440 Define &Input Cellmw Insert Input CellmwInsertInputCell.MAIN Define &AutoInit Cellmw Insert Auto Init CellmwInsertAutoInitCell.MAIN Define Calc &Zonemw Insert Recalc ZonemwInsertRecalcZone.MAIN &Undefine Cellsmw Undefine CellsmwUndefineCells.MAIN &Purge Output Cellsmw Matlab Purge OutputmwMatlabPurgeOutput.MAIN  &Group Cellsmw Group CellsmwGroupCells.MAIN Ungrou&p Cellsmw Ungroup CellsmwUngroupCells.MAIN(Hide &Cell Markersmw Show Hide Cell MarksmwShowHideCellMarks.MAIN(Toggle Graph Output for Cellmw Toggle GraphmwToggleGraph.MAIN Evaluate &Cellmw Matlab EvalmwMatlabEval.MAIN Evaluate Calc &Zonemw Matlab Recalc ZonemwMatlabRecalcZone.MAIN Evaluate &M-bookmw Matlab RecalcmwMatlabRecalc.MAIN Evaluate &Loopmw Matlab Repeat EvalmwMatlabRepeatEval.MAIN Bring MATLAB to Frontmw Matlab to FrontmwMatlabToFront.MAIN Notebook &Options...mw Notebook OptionsmwNotebookOptions.MAIN%~ 6Jaxi,q qqH New Note&book Purge &Output&Recalc Notebook Paste &Figure &Input Chunk&Comment Chunk MatlabHelpComment&TemplateProject.mwMatlabEval.EditPasteRecalc Current &ZoneM-book &Options&Workspace Tool...Path &Manager...Toggle Graphic Output for CellDefine Calc &Zone&Input Chunk alt-I&Input Chunk Alt+I&Comment Chunk Alt+C&Input Chunk Alt+IShow &Workspace ViewShow &Workspace&About MATLAB Notebook... New &Notebook &Notebook&Insert Input Cell&Workspace View&MatlabPath Tool...&MatlabPurgeOutput&Purge Output Cells &Matlabpath Tool...Current &Figure...Show &Cell Markers7Hide &Cell Markers &MATLAB HelpInsert &AutoCalc Cell&Workspace Tools...Insert Recalc &ZoneRecalc &Current Zone&Notebook Help Recalc &CellInsert &Recalc ZoneInsert &Input CellRecalc &NotebookRecalc Current &CellNotebook &OptionsNotebook &Options... Recalc &ZoneAbout MATLAB No&tebookDefine &Recalc Zone&MATbookDefine &Input CellDefine &AutoCalc CellDefine &Calc ZoneEvaluate &ZoneEvaluate &NotebookEvaluate &CellMATBook &Options...Evaluate &MATBook&MATBookMATbook &Options... &MATbook HelpEvaluate &MATbook New &MATbook&MATLAB Path Tool...&Workspace Browser...&Undefine Cells&Undefine CellDefine &AutoInit CellEvaluate &Section &Group CellsUngrou&p Cells Ungrou&p Cell&Purge Selected Output Cells&Purge Selected OutputEvaluate &CellsEvaluate &M-bookEvaluate &M-Book&M-bookM-book &Options...&About MATLAB Notebook New &M-bookEvaluate Calc &ZoneEvaluate &Loop-TemplateProject.mwNewNotebookFromCmdLine.MAIN&Hide Cell Marks&Hide Cell MarkersToggle Graph Output for CellBring MATLAB to Front)TemplateProject.mwInsertAutoInitCell.MAIN(TemplateProject.mwShowHideCellMarks.MAIN(TemplateProject.mwNotebookHelpAbout.MAIN(TemplateProject.mwMatlabPurgeOutput.MAIN'TemplateProject.mwMatlabRepeatEval.MAIN'TemplateProject.mwMatlabRecalcZone.MAIN'TemplateProject.mwInsertRecalcZone.MAIN&TemplateProject.mwNotebookOptions.MAIN&TemplateProject.mwInsertInputCell.MAIN$TemplateProject.mwUndefineCells.MAIN$TemplateProject.mwMatlabToFront.MAIN$TemplateProject.mwMatlabStartup.MAIN#TemplateProject.mwUngroupCells.MAIN#TemplateProject.mwMatlabRecalc.MAIN"TemplateProject.mwToggleGraph.MAIN"TemplateProject.mwNewNotebook.MAIN!TemplateProject.mwMatlabHelp.MAIN!TemplateProject.mwMatlabEval.MAIN!TemplateProject.mwGroupCells.MAINTemplateProject.AutoClose.MAINTemplateProject.AutoOpen.MAINTemplateProject.AutoExit.MAINTemplateProject.AutoNew.MAINTEMPLATEPROJECT.AUTONEW.MAINTEMPLATEPROJECT.AUTOEXIT.MAINTEMPLATEPROJECT.AUTOOPEN.MAINTEMPLATEPROJECT.AUTOCLOSE.MAIN!TEMPLATEPROJECT.MWGROUPCELLS.MAIN!TEMPLATEPROJECT.MWMATLABEVAL.MAIN!TEMPLATEPROJECT.MWMATLABHELP.MAIN"TEMPLATEPROJECT.MWNEWNOTEBOOK.MAIN"TEMPLATEPROJECT.MWTOGGLEGRAPH.MAIN #TEMPLATEPROJECT.MWMATLABRECALC.MAIN #TEMPLATEPROJECT.MWUNGROUPCELLS.MAIN $TEMPLATEPROJECT.MWMATLABSTARTUP.MAIN $TEMPLATEPROJECT.MWMATLABTOFRONT.MAIN $TEMPLATEPROJECT.MWUNDEFINECELLS.MAIN&TEMPLATEPROJECT.MWINSERTINPUTCELL.MAIN&TEMPLATEPROJECT.MWMATLABEVAL.EDITPASTE&TEMPLATEPROJECT.MWNOTEBOOKOPTIONS.MAIN'TEMPLATEPROJECT.MWINSERTRECALCZONE.MAIN'TEMPLATEPROJECT.MWMATLABRECALCZONE.MAIN'TEMPLATEPROJECT.MWMATLABREPEATEVAL.MAIN(TEMPLATEPROJECT.MWMATLABPURGEOUTPUT.MAIN(TEMPLATEPROJECT.MWNOTEBOOKHELPABOUT.MAIN(TEMPLATEPROJECT.MWSHOWHIDECELLMARKS.MAIN)TEMPLATEPROJECT.MWINSERTAUTOINITCELL.MAIN-TEMPLATEPROJECT.MWNEWNOTEBOOKFROMCMDLINE.MAIN@d@UnknownG:Times New Roman5Symbol3& :ArialG5  hMS Mincho-3 fg?5 :Courier New"CV h8r&@r&;r&C$V20d|J2VThe MATLAB Notebook v1.5.2!Template for The MATLAB Notebook The MathWorks, Inc. (c)1994-1998ecet iD@DNormal#CJ OJQJ_HmHnHsH tH u<A@< Default Paragraph Font  @d$@Unknown Oh+'0(4H Xd    The MATLAB Notebook v1.5.2"Template for The MATLAB Notebook os!The MathWorks, Inc. (c)1994-1998oshe he  problem2orkecetem23etMicrosoft Word 9.0 @ @7@.@(C ՜.+,0$ px  The MathWorks, Inc.. The MATLAB Notebook v1.5.2 Titleg  !"#$%&'()*+,-./01j3456789;<=>?@ADEltHIJKLMNOPQkSTUVWXYZ[\]^_`abcdefghijmnoqprsuxyz{|}~Root Entry F`GData 1Table~CWordDocumentSummaryInformation(2DocumentSummaryInformation8:MacrosYW dVBA' ddirAutoNew M __SRP_0R0__SRP_1 QJ  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPRSTUVWXYZ\]^_`bdehijklmoqsuwy{|~0* pHdTemplateProjectQH@  = | BC3 J< 9stdole>stdoleP f%\*\G{00020430-C 0046}#2.0#0#C:\WINNT\System32\STDOLE2.TLB# Automation#/MSForms>!SFErms/z pFD8B7FCB4-B7D5-11D3-99C9F9027B`A699AF3.TWD#Micr@osoft = ` Ob Li`brary904j?581D44:55B?0-B6F2?A0249C4B 47?p\VB$E\_V3jyO_.iF<_0_PG-SWor4?- 4-H#_2\Clofs2pC0oPe_$;)5]4 Open2@(юoqc6_ ExiU[ExiPX\v 0R 2O@0   xXT T (6 LBC3 $*\Rffff*123479b29c*\R1*#c1*\R1*#17b*\R0*#d0 `kp[$$x`H:\ @l @\ @L @H @8 @4 H@$ @ x@ME J P D` J" <0h@"+p&+ $+&+0h8o@ (+x 2h4h @$+P x% J " J0D *******************************************************************x AutoNew= Macro is executed when a new Notebook document is created. D *******************************************************************5--- set Factory default settings for the Notebook docInputCellCount$: %8 B@Z MATLABFmtShort B@ZMATLABFmtStyleLoose B@ZMATLABFigEmbedYES B@ZMATLABFigUnitsInches B@ZMATLABFigWidth$: %8 B@ZMATLABFigHeight @$: %8 B@ZMATLABStopOnErrorYES B@ZShowCellMarkers$: %8 B@ZShowRecalcMarkers$: %8 B@Z:--- initialize "did we ask if user wants to close MATLAB?"AskedForShutdownno B@Z--- startup MATLABmwMatlabStartup B@(lHD ******************************************************************* End of MacroD *******************************************************************x:Attribute VB_Name = "AutoNew" 0 ' *? Macro is execd when a new Notebook do@cument(created.?BPublic Sub MAIN () '--- set Factory d@efault tings for0 the SWordBasic.SetD^Var "InputCellCount", [LTrim$](Str(0)C%MAT LABFm""Sphortԁ\ Style>"LoosebigEmbedAYESigUnitsA Inches'Width4I4IigHeigh\3.5A]p]StopOnErxror5Ciw~MarkerC 515Reca\lcc&icialize "di@e ask if user wants to cl`C`bL?^6AskedForShutdown"no(staprtupd G Call "mwMatlabScEnds~߁ a]g of B  rU~}            ! # % ' ) + - /  1 3 9CtlIdActionSuppValidwvalvalueunitscommand_type_blockcellNamecellTyK)^@          rU~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  }U'i   a )  9 )  y ) (  ) @  ) P  nX A ) ` q ) x a )P y  ) h Q )  1a )  Ya )   )  a ")  ! $)  I  &)  1 () f9 Ya *)  NQ y ,) ( a .) @ a )  a 0) X a 2) p 1  M-BOOK ThisDocumentTemplateProjectModule1mwNewNotebookFromCmdLinemwInsertAutoInitCellmwShowHideCellMarksmwNotebookHelpAboutmwMatlabPurgeOutputmwMatlabRepeatEvalmwMatlabRecalcZonemwInsertRecalcZonemwNotebookOptionsmwInsertInputCellmwUndefineCellsmwMatlabToFrontmwMatlabStartupmwUngroupCellsmwMatlabRecalcVBA mwToggleGraph mwNewNotebook mwMatlabHelp mwMatlabEval mwGroupCells AutoCloseAutoOpenAutoExitAutoNewF=C:\Program Files\Common Files\Microsoft Shared\VBA\VBA332.dll I q( F &E:\Microsoft Office\Office\MSWORD8.OLBWord Q y80FC:\WINNT\System32\STDOLE2.TLBstdoleInitFromSavedSettings AiHDX[$KGC:\WINNT\System32\MSForms.TWDMSForms aA X.E .`M DX[$KGC:\temp\VBE\MSForms.EXD i A  hL-[DR $E:\Microsoft Office\Office\MSO97.DLLOffice ! I xMAIN  VBA332.DLL I e  F InputCellCount LTrim$ F SetDocumentVar MATLABFmt Short MATLABFmtStyle Loose MATLABFigEmbed YES MATLABFigUnits Inches MATLABFigWidth MATLABFigHeight MATLABStopOnError InchesToAny ShowCellMarkers ShowRecalcMarkers AskedForShutdown no mwMatlabStartupCallk Ff:=Z\$KG Fe:=Z\$KG FDocument @ AboutCallback RepeatEval PressStart 22x\$4DTdOptionsCallbackAdjustFigWHforUnits AnyToInches EvalString InputCellFromSelection IsNestedInput UndefineCell ExecuteMatlab UngroupCellRecalcDocument ToggleGraphWinHelpA USER32.DLL WinHelpA hGetActiveWindow GetActiveWindow i EvalInputCellInsertEmbeddedFigureSetFocusToWordEvalWithResult DeleteCellGetSelectedCells CloseMATLAB WaitCursorToolsAutoCorrectSmartQuotesWW7_ToolsOptionsAutoFormat ReplaceQuotes ToolsAutoCorrect SentenceCaps I  8 AppInfo$ ToolsOptionsSpelling HideSpellingErrors ToolsOptionsEdit SmartCutPaste ToolsOptionsView Bookmarks ToolsOptionsGeneral WPDocNavKeys 'mwNotebookOptions.InitFromSavedSettings matlab.exe MATLAB AppIsRunning ' MATLAB Command Window GetPrivateProfileString$ Notebook Settings matlab-path matlab.ini c:\matlab\bin InputBox$ Enter path for MATLAB MATLAB Startup SetPrivateProfileString Starting MATLAB...PrintStatusBar DefaultDir$ChDir \Shell Microsoft Word AppActivate MATLAB is runningBeep Cannot start MATLABScreenUpdatingIsTemplateDirty GetDocumentVar$Val Hide &Cell Markers Show &Cell Markers mwShowHideCellMarks Notebook ToolsCustomizeMenusCategoryNamePositionMenuMenuTextRenameContext SetTemplateDirty SetDocumentDirty I  P plus format +; format  ; system_dependent(12,'on'); whitebg(0,'white'); system_dependent(12,'off'); CurValues Plus whitebg(0,'black'); MATLABFig16Color system_dependent(14,'on'); system_dependent(14,'off'); +set(0,'defaultfigureinverthardcopy','off'); close all; DialogRecord DocumentStatistics WindowName$ CountWindowsIsMacrotemplateFileName I x h tod.koob-m m-book.dot NextWindowActivate AutoExit.CloseMATLAB MATLAB Command Window yes Do you want to shutdown MATLAB? Closing NotebookMsgBoxAppClose Bank mwMatlabEval.EvalString whitebg(0,'black');close all; MATLAB Workspace wsptool MATLAB Search Path mlptoolDDETerminateAll Engine DDEInitiate MATLAB computing... DDEExecute DDETerminate \StartOfSel Hex Error: MATLAB is not running m-bookFileNewCountBookmarks BookmarkName$ \sel CmpBookmarks INPUT AUTOINIT (mwInsertInputCell.InputCellFromSelection Input INPUT_ ExistingBookmark AUTOINIT_ OUTPUT WW7_EditGoTo Error: Notebook programmer error I ` GetSelStartPos GetSelEndPos selection \para paragraph RTrim$ GetBookmark$ \startofsel InsertPara SetSelRange I   _ StyleName$ Selection$ Normal \EndOfSel GetText$  Insert EditBookmarkAdd FormatStyle EndOfLine \Sel \EndOfDocParaUp \ParaCharLeft CopyBookmark   ResetCharAtEndOfDocumentSizeY Right$ format compact; Destination CharRight (no graph) NO DDERequest$ EngStringResult EngFigureResult OUTPUT_ EmptyBookmark WW6_EditClearDelete ???  Error Output Left$ParaDownSizeX MatlabFmtStyle mwInsertInputCell.IsNestedInputGoBack SetStartOfBookmarkExtendSelectionCancel Compact EditPaste mwNotebookOptions.InchesToAny$ mwNotebookOptions.AnyToInches$ Points FormatPictureSetSize Centimeters mwMatlabRecalc.RecalcDocument AutoInit all mwMatlabEval.EvalInputCell ScreenRefreshu F EditPaste F F F EditClear DlgText$ FigWidth FigUnitsDlgText FigHeight Long Short e Long e Rational Notebook Options !mwNotebookOptions.OptionsCallback BeginDialog &OK OKButt PushButton &Cancel CancelButt Numeric FormatGroupBox Figure Options Embed Figures in M-book FigEmbedFlagCheckBox Stop evaluating on error StopOnErrorFlag Use 16-Color Figures Fig16ColorFlag MLFormatList DropListBox FormatOptions OptionGroup LooseFmt OptionButton CompactFmt Units Text3Text Width Text1 Height Text2TextBox EndDialog UserDialogDialogDlgValue DlgEnable \endofsel mwGroupCells.GetSelectedCells Evaluate Loop mwMatlabRepeatEval.RepeatEval S&tart start &Pause pause Loop Count: LoopCountText &Close close Stop After: stopAtText stopAtCount Loop Speed: Text4 &Faster idleFast &Slower idleSlow ;To use Evaluate Loop, first select one or more input cells. Error in MatlabRepeatEval 0 10DlgFocus &Resume S&top MenuItemText$ Show Menu Bar F F FControlsCaption d:\v5\bin\nt\wb001.emf InsertPicture c:\wb001.emf C:\ May, 1997 C:\wb001.emf F WW7_EditGotTo F Fg Fh F^ FClearCollapse [] FHeightWidth \MATLAB.HLP winhelp WinHelp Could not start Windows Help About MATLAB Notebook All Rights ReservedOKButton +Copyright (c) 1984-1996 The MathWorks, Inc. The MATLAB Notebook for Windows Text5 Version 1.5 Text6 November 15, 1996 +Copyright (c) 1984-1997 The MathWorks, Inc. Version 1.5.1 " + AppPath$ +  + AppName$ + " "  \ /" + AppPath$ +  + AppName$ +  ' M-BOOK.DOT FileClose 22x$4DTd AppRestore I U   MATLABpe inputMarkhWnd lpHelpFilewCmddwData StrResult foundCells__ foundCount,rU~}  ) yILL  %:h%x"$ @xx+:h%:X%x"$ @xx+:h%:X%x"$ @x x$$ __SRP_2[\__SRP_3 ae__SRP_4c__SRP_5 f@xkrU $`prU 49aacrU @prU~}  __SRP_6g__SRP_7ne__SRP_8pT__SRP_9re 1 8 0m1((m):h%x"$ @xx%:h%x"$ @xx%(h%x"$ @xx%(h%x"$ @x xx"$ @x x$ xkrU $`prU~} krU $`prU~}  krU $ `p__SRP_atT__SRP_bve__SRP_cx^__SRP_dzrU~}  frU $ `0 ` 0//prU~} krU $__SRP_e}T__SRP_feAutoExitw)AutoOpen; `px,XT6TH (6 L<BC3 "*\Rffff*13479IJHxXTT (6 L<BC3 $*\Rffff*113479b29c*\R1*#b1*\R1*#16bX @`  `@k00 +Px@h ****Pd****@on I$8$@@(T @ @pP @@ @X0 @ @ cr@ @ @ @ j*@  @ @8 @ @ME A J P *h J F 0 " PX$` J  J"HPX` h    "6 0R7.8 $% H 6%P&+ F :PH+   B(&7p% (7%  J "X J D *******************************************************************x AutoExit6T# Shutdown macro for Notebook DocsD *******************************************************************?Declare Function IsAppLoaded Lib "kernel32"(name$) As Integer \ Alias "GetModuleHandleA"A@AskedForShutdownno B@ZlpD ******************************************************************* CloseMATLABD *******************************************************************@ZZZ matlab.exe' ' -- No@E2AskedForShutdown %' *--- Check if user wants to shutdown MATLAB MATLAB Command Window %' MATLAB Command Window % yesDo you want to shutdown MATLAB?Closing Notebook$ %' MATLAB Command Window %MATLAB Command Window B@a' MATLAB Command Window B@hphhAskedForShutdownyes B@Zh8@--- If MATLAB is still alive and the user chose to not shutdown,4--- we need to restore the figure defaults to normal MATLAB Command Window %' MATLAB Command Window %mwMatlabEval.EvalStringwhitebg(0,'black');close all; B@(h2<--- Close the workspace browser and pathtool if they're openMATLAB Workspace %wsptool B@hHMATLAB Search Path %mlptool B@hlD ******************************************************************* End of MacroD *******************************************************************( Attribute VB_Name = "AutoExit" ` ' *?  Shutdown macro for Notebook D8ocs%BzHDeclare Function IsAppLoaded Lib "kernel32"(n$) As Integer \E Alias "GetModuleHandleAPublic Sub MAIN()  CloseM ATLABWordBasic.SetrumentVarskedFor", "no.End+LŊLxi Prxiva@AACDim \$ ArcYesNoalreadyfA@ Amatlab.exe@C 0 '--@FOn ErrGoTo -1: KDoneo c[uc$x]("B#Idu-@Check if uswants to sEa|If (5IsRunning(" Comm! Win") <> 0 Or$ _C A)A@KB`"yes" Then-MsgBox("Do you {?@W`c"AB @6|36e%'-1)( (=@! T T1/ ElsGe1C< 1|If|e y7 $T&#is still @alive aMtdhe#WchA8notW,Dwe ne[restofigu@@defaul^normal 80 L__,(gO-iiII' Ca ""mwMEvalJ.Sng S"whiTg(0,'black');c(l;IJ5:'B%workspace browa/pathtooly'`)opn'5D9# ńu*Zwsp!  b4jISearch P  "ml}(p`bo}0)7/of M b29c*\R1*#b1*\R1*#16b `Xk p$$`Hh @x @h @X Hx@ME J P Dh J"%8+( @`$+ J "  JHD ******************************************************************* AutoOpen= Macro run whenever an existing Notebook document is openedD *******************************************************************mwMatlabStartup B@(mwMatlabRecalc.RecalcDocumentAutoInit B@(:--- initialize "did we ask if user wants to close MATLAB?"AskedForShutdownno B@Zl0D ******************************************************************* End of MacroD *******************************************************************`OAttribute VB_Name = "AutoOpen" ` ' *?  Macro run whenever an existing Notebook document is oed?BPublic Sub MAIN()  WordBasic.Call "mwMatlabStartupRecalc.D^",0Init '--- iialize "did we ask if uswants to closeSTLADB?ASet5Var5skedForShutdo$wn?noEnvdwF'2of w?By rU~} a__SRP_10h__SRP_11__SRP_12T__SRP_13#erU x$`0` 0//$`prU~} krU $`p__SRP_14T__SRP_15 "e__SRP_160__SRP_17!%rU~} krU $`prU $`0` 0//$`,` 00,!rU~} x $))%q% %%9& Y&aab9babb((! I))) *9*qi9 IQ**1+ ,i,,A--.i##6a666")7#a7 8a$Y O73+ P9PiP LYKPPQQQRQRRRSASS TQTTTIUUVIVVV W9WIyWWW X)XQXyXXIOOXOX+)YaYOYYN 1EIn4 5Thd9lh;:lh;;lh;<lh;=lh;>lh;?lh;@lh;Ald;Bld;Cld;7(P%(@&%:0D%: E%`"$ @`F`C(P+%(@%(0X%( %:G%:H%`"$ @`I`C(P%(@%(0X%( %:J%:K%`"$ @`I`=(P %(@%(0%( N%:L%`"$ @`M`=(P %(@a%(0%( %:N%`"$ @`M`C(P%(@o%(0%( %:O%:P%`"$ @`Q`C(P%(@%(0%( %:R%:S%`"$ @`Q`C(P%(@%(0%( %:T%:U%`"$ @`Q`D(P%(@%(0%( b%h`:V%`"$ @`W`%:PX%`"$ @`Y`C(P%(@*%(0%( %:Z%:[%`"$ @`\`C(P%(@;%(0%( %:]%:^%`"$ @`\`C(P%(@%(0(%( %:_%:`%`"$ @`a`C(P%(@%(0-%( %:b%:c%`"$ @`a`C(P%(@%(03%( %:d%:e%`"$ @`a`D(PX%(@%(0%( l%d`:f%`"$ @`W`=(PX%(@%(0%( %:g%`"$ @`h`=(PX%(@%(0%( %:i%`"$ @`h``"$ @`j`2`"$ @`WkWl4`66 @`"$ @`Wmll`5W@(lhasd\h` T  XHH(X]/8\6:8%:X%4"$ @4$`1h45$lhJ,:XV%h@4"$ @4n4+:XV%:89%4"$ @4n4?:8%:X%4"$ @4$:]]/45$\0+:XX%(8%4"$ @4o4]+:XX%(8%4"$ @4o4?:8%:X!%4"$ @4$:"]/45$\x+:XP%(8%4"$ @4o4+:XU%(8%4"$ @4p4+:Xf%(8%4"$ @4p4+:Xg%(8%4"$ @4p4+:Xi%(8%4"$ @4p4Q+:XP%(8%4"$ @4o4+:XU%(8%4"$ @4p4+:Xf%(8%4"$ @4p4+:Xg%(8%4"$ @4p4+:Xi%(8%4"$ @4p4?:8%:Xq%4"$ @4$:"]/45$\+:XS%(8%4"$ @4o4+:XS%(8%4"$ @4o4?:8%:X'%4"$ @4$:"]/45$\\+:XU%(8%4"$ @4o4+:XU%(8%4"$ @4o46:8%:X%4"$ @4$`1h45$ lhTlhJ ,:Xf%h@4"$ @4n46+:Xf%:8A%4"$ @4n4W:g%:8%:X%4"$ @4$%"$ @n)45$W:i%:8%:X %4"$ @4$%"$ @n)45$G H(X]/8\E P0%:XU%4"$ @4p4%:Xf%4"$ @4p4%:Xg%4"$ @4p4%:Xi%4"$ @4p4 f0 r H0@ W:%:8s%:XV%4"$ @4$%"$ @t)45$7:XX%4"$ @4$o(8]/45$\}+:X%:8]%4"$ @4t4+:X%:8Z%4"$ @4t47:XP%4"$ @4$o(8]/45$\+:X!%:8"%4"$ @4t4>+:X!%:8u%4"$ @4t47:XS%4"$ @4$o(8]/45$\+:Xq%:8"%4"$ @4t4+:Xq%:8u%4"$ @4t47:XU%4"$ @4$o(8]/45$\9 +:X'%:8"%4"$ @4t4f +:X'%:8u%4"$ @4t4W:%:8s%:Xf%4"$ @4$%"$ @t)45$d:8s%:Xg%4"$ @4$%"$ @(]p)46$\z W:%:8s%:Xg%4"$ @4$%"$ @t)45$d:8s%:Xi%4"$ @4$%"$ @(]p)46$\7 W: %:8s%:Xi%4"$ @4$%"$ @t)45$ vG 5HT 0G lHh 4$0   0   0 X  P%(8%H"$ @HH%(8%H"$ @HH%H"$ @H(lHW:%:8%H"$ @H(%"$ @\)H5(\(8]p(\ CX CX*\ @H"$ @H  HllXF%(%: %:8%H"$ H H  ,()H5(l(8]/(\%(8%H"$ @HH%(8%H"$ @HH:%:8%H"$ @H((]p:%:%"$ @(]p|'l)H6(\7N:%:8%H"$ @H( :]/H6(\CT"[::%:8%H"$ @H( :`1TH6(lTChh /h:%:8%H"$ @H((]p:%:%"$ @(]p|'l:H%:X %"$ @8((]p')H6(8\?:%:8!%H"$ @H(:"]/H5(\R#CT$CPd%CT&CP?:%:8'%H"$ @H(:"]/H5(\ lT(*1T lT)*1T!lT**#hlP*#+*1T2hlTChh /h,CL%(8%H"$ @HH%(8%H"$ @HHP<$LXT\PlPhH(|l8(DKKh"$ @h.h1:X/%:H0%h"$ @h81lh%:X2%h"$ @h3h-l @l @h"$ @h4h%:X5%h"$ @h3h#l%h"$ @h6h?%:X7%h"$ @h3hh"$ @h8hDD(?lh8M` 00$I`(q`!0prU~} arU $`(`A0(`Y0p__SRP_18h__SRP_19$&__SRP_1a^__SRP_1b7rU~} frU $`(`q0prU~}  2 A)y__SRP_1c__SRP_1d(*e__SRP_1e2__SRP_1f)-#nnoo:h%x"$ @xH(X]/8:$%4"$ @4(]/')x46H\%:h%x"$ @xx8:h%x"$ @xHDX]/8x5H\(8:hNHH 6H8%:h%x"$ @x x8:h%x"$ @xHDX]/8x5H\+:h %(X%x"$ @x x%:h %x"$ @x x$ (x4H8krU $`prU~} 0 )aQ!q Y!y2A1 I !q!!)"""#<1#I#i### $a$$<\ \ll(L]/\\%(L%H"$ @HH%(L%H"$ @HH)(L%H"$ @HH)(L%H"$ @H HD:8 %(L%H"$ @H\`#4 /4H5\)(L%H"$ @H  H)(L%H"$ @HH)(L%H"$ @HH)(L%H"$ @HH%:L%H"$ @HH%(L%H"$ @HHH(l4H\Cho:H%X"$ @X((8]/:%"$ @(]/')X6(\B:%:H%:8%:%X"$ @X(`1dX5(KKUldJWCdC:%:H %:8!%d@X"$ @X(`1dX5(8:H%:8%d@:%X"$ @X"X%(H%X"$ @XX%:H#%X"$ @X$X6:8%%(H%X"$ @X(`1`X5(&d@X"$ @X&Xv"( '(ldFH:8(lhF" '%(%X"$ @X)X6 (*C\,\@(H%X"$ @X+X&`@X"$ @X&X%:H,%X"$ @X$X%(H%X"$ @XXC%:H-%X"$ @X$X (Hl (HlX"$ @X.X%:H/%X"$ @X$X8 l`\hd,X(frU $`$`prU~} ! __SRP_20^__SRP_21,.__SRP_22__SRP_23+3frU $ `( `q0prU~} #" 8 M9 :?A==)19)MyMq%IQ?0       !#$%&'()*+,-./0234568:;<>?@ABCDEFGHIJKLMOQRSTUVWXYZ[\]^_`abcefhijklmnopqrstuvwxy{}~ H1"$ @(]/5\8 0ZCxCtl M@ `1x5l M@ `1t5%"$ @d%"$ @ T%(%"$ @ 1"$ @(D5D"(4DhM: %4(%"$ @`#4"l;/6 4~b(4Dhx"4"llxi$"4"llti#$(]p(]ph\8: %4"lF%"$ @ "$ @P(]/:X%:%"$ @:H]/h'85\ D4 4~x%(%"$ @ -d @T @"$ @DHdJx4T$DdxtF$h8frU "$"`("`0prU~} %$frU $$$`($`0p__SRP_24^__SRP_2502__SRP_26T__SRP_2715erU~} '&krU &$&`prU~} )(krU (8Dp !$__SRP_28\__SRP_2946__SRP_2a"__SRP_2b/?1g p$(`prU~} +* 6a666")7#a7 8a$0  0 @  0   0 @  0   DKKh"$ @hh1:X%:H%h"$ @h8lh%:X%h"$ @hh-l @l @h"$ @h h%:X %h"$ @hh#l%h"$ @h h?%:X %h"$ @hhh"$ @h hDD(?lh80 h  MrU *$*`(*`0(*`90$*`$!*`(I*`!0(q*`!0prU~} -,__SRP_2c7h__SRP_2d8:9__SRP_2e=4__SRP_2f9=NearU ,$,`(,`q00,`Yp/prU~} /. ./Y///+ 090#i01#I)0 1I111y4:f$%4"$ @4W48460:$%4"$ @4`1x456($h4"$ @44h^7($%4"$ @4(]/45\208 @4"$ @4W458W `1d58W `1`5 C\ldJi$LDL($]p(L"dM@ : ]<'t6\6l\F(L"dM$@ `1\6L($LCJ\M$@ :]/`M@ :]/t6\0<($<4"$ @44 h~&x@4"$ @44<($]I\%:$%4"$ @44P8 L\x<d`h8$4tkrU .$.`p__SRP_30P__SRP_31<>d__SRP_32g__SRP_33;GzerU~} 10 q% 2A221333 4y4y5Y5550  DCx (ThKK6:@%:T%P"$ @P0`1dP50:T%P"$ @P0(@]< : %"$ @(]<ld =')P60\7:T %:@ %( $%P"$ @P0 hPhDT]/0\8:T%P"$ @P0D@]/ P50\~%:T%P"$ @P P%:T%P"$ @P P+:T%:@ %P"$ @PPh(T]/0:@%P"$ @P ( ]<:%"$ @(]<')P6 \+:T%:@%P"$ @PP7:T%P"$ @P0(@]< P50\%:T%P"$ @P P7:T%P"$ @P0(@]< P50\=%:T%P"$ @P PD0=hdx0 P0 frU 0$0`$0`prU~} 32i Y ! Y Ii9 Y )y<h:$%:8%(\L L%H"$ @H%4"$ @4)H46\L+:l%:8%H"$ @HH+:l %:8 %H"$ @HH+:l %:8 %H"$ @HH+:l %:8%H"$ @HHh:$%:8%(\L L%H"$ @H%4"$ @4)H46\Lo:$%:8%\ @L L%H"$ @H%4"$ @4)H46\L+:l%:8 %H"$ @HHh:$%:8%(\L L%H"$ @H%4"$ @4)H46\Lh:$%:8%(\L L%H"$ @H%4"$ @4)H46\L+:l%:8%H"$ @HH%:l%H"$ @HHh<$ H4\LkrU 2$2`p<f:=Z\$KG Fe:=Z\$KGx8XTZT#e:=Z\$KGf:=Z\$KG4AutoClose9mwGroupCells@B+,mwMatlabEval(mwMatlabHelpAE>x7XT4TS; (6 LBC3 $*\Rffff*103479b29c*\R0*#c*\R1*#b1*\R1*#16b `ptk((  Ppx@rh [P"dxPtX`Pv\@L B@@@xp<  `z8 texn0$nh$@(X@ @4 @$ @p @0 @ @ @ `g sp@ nt@H Wor@x @ $&@ mwN@t mw@@ME 1 J P *h J F 0 "PX`hpx"< 0 67 0     0 8 (DH6p  @J   &( 8"%Hpx J " J PD ******************************************************************* AutoClose# Shutdown macro for Notebook Docs+D *******************************************************************?Declare Function IsAppLoaded Lib "kernel32"(name$) As Integer \ Alias "GetModuleHandleA"Z@ZXZpZZZZZE !|%~.z %' p r % % z !xB@~ z!"' " z!' t\End' v "'B@  " $\ v " $ ' vX  '--X v$ tod.koob-m t$ m-book.dot x 'xnehh B@?-- ract fo p B@$te xine,AutoExit.CloseMATLAB B@(hlD *******************************************************************% End of MacroD *******************************************************************mpactAttribute VB_Name = "AutoClose" ' *? Shutdown macro for Notebook pDocs%B{HDeclare Function IsAppLoaded Lib "kernel32"(n$) As Integer \E Alias "GetModuleHa ndleAPublic Sub MAIN() Dim oriDg$winvNumtemplXate9_reversed inCoun0t 0do cInfoVObject: Set  = WordBasic.DialogRec.umentStatistics(False..[W0G]A8 Fm7 p1 ToH+Cs' .If Is"M(0)0 pThenE G!CurValues0=ZE.K Ca File…"h "iLen(T Wh i > 0 And Mid , i, 1) <> "\  +6AA&i - 1Wend+3LCase(f 3"tod.koob-m" _+ Or '(Bm-y.dot": [`'+E@&If'ENextO pAvrev <= [CS'CallExit.BMATLAB9E ?"f! of> j >x$ XT2T@ H#P6 <<<< <<<BC3 "*\Rffff*f3479b29c ``H@UU @l XP^dHP```@0xP pPL@< @, @ p @d`@ZY @l b`t@yf PX 8Ih N@jl @\ @L PlH@8 `ZP$Z$ph PH0P:d6P| ( L e@ `X @ @  @ ( R@ @| lN*l *h (8XX P?H `?FHBX8x( $*X$ G@ "@ @ :$ $  @ lhx@ @ @@ @@ Kt  H pnmn Xh @X s (H @8 ( p @ dW@  @ <w@ @ ( &@ B`ME J P @h J" (08@HP 4`         6(%`%p <<t&N ( *84ih   PB 0 @T`  0N&N( P ` h 6p   * %  >=( h x2      * 2 >2 %Xp 0x%%  J ( @ J`"9* %  &[ PH  h  %p   : 8  H 60 %h  x       2      J 8 DX , J "  ( 0 8 @ H 2P  1     A 2         J "@ Jh D ******************************************************************* GroupCells9 Convert selected input cells into a single input cell.D *******************************************************************Z@ \pZxZZZZZZ 8.--- Get all the cells in the current selection  A@b   \X$ ' ^ ^AUTOINIT~ AutoInit' `aInput' `h/--- hide screen activity, show hourglass cursor B@p  B@46--- kill firstMark's matching output cell if it exists ^ ^ ^_~ % %'0OUTPUT_ 0$: %8 '  A@d #--- firstMark must be an input cell`   `$6_ 0$: %8 ' ^ '    $ INPUT~  $ AUTOINIT~ *--- capture the contents of the input cell--- and then kill it $  % + \  ' $ A@d*--- kill matching output cell if it exists $  $  $ _~ % %'0OUTPUT_ 0$: %8 '  A@d h0--- Build the new cell from contents of selected--- input cells  ^ B@D \EndOfSel B@D B@$   mwInsertInputCell.IsNestedInput\sel %( B@ B@6,hp $ \ B@ B@6@ B@ B@ ^ B@D ^B B@@(mwInsertInputCell.InputCellFromSelection ` %(' \EndOfSel B@Dh)--- restore screen, restore normal cursor B@p B@4h0l(D ******************************************************************* DeleteCell Delete the named cellD ******************************************************************* `Z  %<  B@D OUTPUT~ @ %'   % $  % B@h B@H B@\sel %:bx 1--- check if cell contents is the whole paragraph\sel % $ \para %0--- 2 means delete the selection and the newline B@a B@hha` B B@@ B@h(h lD *******************************************************************  GetSelectedCells> Fill an array of cell names found in the current selection.& Also sets the count of found cells. D *******************************************************************existiZxZZZZ+--- Find all cells in the current selectionno'j % 's no ve o  f    %' l\sel l %'B@  $  lINPUT~  lAUTOINIT~  lOUTPUT~      l j+ f j 'jh0(h  j'hlD *******************************************************************  End of Macroall thD ******************************************************************* @Attribute VB_Name = "mwGroupCells" ' f*? Convert selected input c{ to a single.;BPublic Sub MAIN() Dim markTotalp ReGUtents__$(0firstM $Styl"eurrNumoutowۄ54i$ AJ> '--- Get all the=W`ion So:,I= If > 1 TheFNH? J@J2InStr(1, , "AUTOINIT")@!0L!A]AutoI8nitElseA IA nd If [hide screen activity, show hourglass cursorGWordBasic.SABUpdat 0WaitCBd 1ki@zF'sgtchÕB if it exists%CI%Val([Right$]( 0Len) -< _ $8_"<))@Baa6OUTPUT_" + LTrimBDYteAY< (h ( "7 must be an(UCase(GE)" '' hBFor i@nop-B- T (F.Fki)gIN*fOr6+n)Dngb+captureon ofoRa m`n b[it/i%)#-@BookA `F(!A`~++iL masEtAt, u 7u>L: ::[:ll l:oO;q|EDXUN ex!'Buil"d&newOfrom ch(wB"HR h > f IWW7_EditGoTo D esP]]on:=OWD!*"\Ofy8haParaDoww5Bp oLpc9 C@(InsoAT.IsN edq0D\wxharLef<wsQ a@A>/w{%1C ExNd6!1g}"n"&uM 1%,p'lete|:= QS7R?t73яF3 ",㬌 20, kw7r`&oPc, normal__ngZX WuWSub*'MIpd PrivaPp  "$a;Star8?Eᡐ%0#-OO"'U, f@EoEtu + xPosUq [}Tb`pelCh3GSet01RangV,E % &OfLine'WW6bfCleax1ZEmpty"[=Ol"8check if cell contents is the whole paragr@aph If (WordBasic.[GetBookmark$]("\sel") + "+ Chr(13)) = _ F|GThen7'--- 2 means delete{ection andnewlinezWW6_EditClear 2 8Els' AIf %? Na0me:=́$, Dp:=1 07 a8@ESub ' *S? S)cPtedCsCF iacrray on7s f$ou@$inBicuTrr o.AlsoAc ntHs 1* PrivaG3(BB6__$((),/C$)  DimTot\alÈi MʃTestbFiCaP UF =0 FG&Es()8 - @ >= 0 kRe uFor i To NAj[Y](i=1$ CmpG#,,b (A0InSt`, @"INPUT>@OrMRAUTpOINI' OUT& ) A@8̜r(0 /3BB<= 91&?f-/)a{*g+!@EŁNexP%CBm=BX !cAs?n>#| Macx D  1 (8HA`2xpm (0 8@  H &X#Vb  6 (PD1x$N2 (N@hp % $.%   ( J0  6 JB  (08@HPX`hpx   0   <t .( X  ` "1p "% % @ (D *8 %P %` 4Qp     6  - & &=( &=P %x @ % 4 8 &NH p 2 + * 7     2( H P X ` (h       ( D 4PGF ( 6 :02p0 @ .$1 @ P)`x*  :*?, H &X hx &+ ) +:  4( `&p+ )% &+ ) (0 8H >=P  %    >*8,P&h x   %  &, @( <h%  & + )(%@ X h+x  * F F( D):p>rX)3@& &@u)58) B@, H,/h,+ ++ *&  +2i%H+XJp & % $ H#P` $h*%  %% J X x B J  J8"   5  &  - 6- 88-. LP*  /3*3* 2' 0 " $I%% J  J" @H Pp  6 , J 6`  J"      "10 "%X - % #   *%   !! J! 4h! :! J!B 0"8" @" P""`" """&"" ## #* # P#`# h#p# Jx# "# J# /D ******************************************************************* MatlabEval6 Sends current input chunk to MATLAB for evaluation.' Creates new output chunk for result.lD *******************************************************************5deZ@ZXZp ZZZZZ--- Setup error handler4@E --- Check that MATLAB is runningl MATLAB Command Window %' MATLAB Command Window %mwMatlabStartup B@(h7--- Find the input cell for the current insertion point>--- Find all input and autoinit cells in the current selection'' % '   8    %' 4\sel 4 %'   4INPUT~  4AUTOINIT~     4 +   ''hh --- Evaluate the selected cells   $ $*'  MATLABStopOnError %YESF  'ga0--- The selection is not an existing input cell,"--- so create one and evaluated it(mwInsertInputCell.InputCellFromSelectionInput %('0 0(h INPUT_ 0$: %8 ' 4 4 %<--- found an autoinit cell AUTOINIT_ 0$: %8 ' 4h 4$*'hx \StartOfSel B@DP--- Error handling needs work  Error: Notebook programmer error B@ B@lD ******************************************************************* EvalInputCell0 Given the name of an input cell, evaluate it.D *******************************************************************@ZZZZZZZ0ZHZ`ZxZZZ@E)--- Signal that we haven't had any errors'* $'  4 4 4_~ % %'0'--- Send input to MATLAB for evaluation6 B@zMATLABEngine %|'xMATLAB computing... B@ B@49--- Set the format to compact for this routine's purposesformat compact; 4 % ' j 4 B@D B@ %'   % (no graph)NO' ,a@MATLABFigEmbed %' ,h x j B@~--- Request results from MATLAB xEngStringResult %8' . xEngFigureResult %8' 0 B@H:--- surpress screen updates while output cell is generated B@p---- If there is no output from MATLAB, remove1--- existing output cell if there is one and exitOUTPUT_ 0$: %8 '  . 0no,--- If there is no output remove output cell  %<  B@D\sel %: B@a B B@@hh<h"--- Check for MATLAB error message .??? }Error' 2'*a8Output' 2h "--- Strip off return in first line . %> F . . %' .g.--- And rip all the returns from the last line . %  . . %>' .0"--- Find corresponding output cell0--- Create a new output cell if there is not one3--- save the format style to follow the output cell  %< %' ( save style:--- if we're at the end of the document or bumping against(--- another cell, insert a new paragraph\sel \EndOfDoc %'  B@6Normal B@Fh 4 B@D B@4--- Put blank lines before and after the output cellMatlabFmtStyle %Loose % % %  B@  B@ B@a  B@hh B@ B@Normal B@F B@ B@ %  B@ % % %  B@  B@ B@ B@Normal B@F B@a(  B@ B@ B@Normal B@Fh h B@h mwInsertInputCell.IsNestedInput\sel %( B@ B@6\para B@D B@ B@@'4h 8--- Insert the text and figure result to the output cell 2 B@F\sel  B@B . B@ 0yes ,YES .A@D B@h@  B@ two spaces B@ B@  B@D\Sel  B@>9--- Add an extra space after output cell because it makes5--- it easier to insert free form text between cells. \EndOfSel B@D B@F B@  B@ B@ B@ B@Normal B@F \EndOfSel B@D B@ 4 B@ B@hX aP $--- Replace the existing output cell?--- For loose formatting, add a blank line after the input cell?--- For compact formatting, delete the blank line, if necessary End If  B@h WordBasic.CharRight WordBasic.CharLeft WordBasic.Insert nl$ WordBasic.CharRight WordBasic.CharLeft 1, 1act WordBasic.WW6_EditClear 0 B@.h 2 B@F . B@ 0yes ,YES .A@Dh B@ %  2ErrorF B@g B@H B@ MatlabFmtStyle %Loose %    B@  B@hh--- restore screen updates B@p--- Close connection to MATLAB<X x B@@--- Error handling needs workError: MATLAB is not running B@ B@ B@ B@4fD ******************************************************************* InsertEmbeddedFigure< Insert the embedded figure by pasting the contents of theC clipboard and then format the picture to the current size set in Notebook Options.D *******************************************************************Z8ZPZhZ $'  . F  B@g B@2--- get current figure sizes (converted to points)A@V@ clear the content of the bookmark without deleting the bookmarkntlD ******************************************************************* SetFocusToWordD *******************************************************************Z--- set focus back to WordMicrosoft Word' nIf DocMaximize() Then0 WordName$ = WordName$ + " - " + WindowName$()End If n B@tlHD *******************************************************************0 Subroutine for sending a string to MATLAB to be evaluated.D *******************************************************************ZP@E B@zMATLABEngine %|'xMATLAB computing... B@ x v B@~ B@ x B@Error: MATLAB is not running B@ B@Hl@D *******************************************************************. Function for sending a string to MATLAB to be3 evaluated. Returns the string result from MATLAB.D *******************************************************************hZ@E B@zMATLABEngine %|'xMATLAB computing... B@ x v B@~ xEngStringResult %8' X B@ x B@@8Error: MATLAB is not running B@ B@' XfD ******************************************************************* End of MacroD *******************************************************************%%&y Selection.PasteSpecial Link:=False, DataType:=wdPasteEnhancedMetafile, ' Placement:=wdInLine, DisplayAsIcon:=FalseX&P'@  B@l'+ Selection.PasteSpecial Placement:=wdInLine&'&0''(''' B@CharLe WordBasic.CharLeft'('( B@ = n((0(X'h(h( 0 B@2Basic.( 999"95(frd =9&9(9*9$ B@49(( B@lectio9f)9f5(fion.9 999"9$9&9(9*n nSelection.InlineShapes.AddPicture FileName:="C:\wb001.emf", LinkToFile:= ' False, SaveWithDocument:=True( !B@* !t:=w WordBasic.CharLeft 2, 1t If WordBasic.[GetDocumentVar$]("MatlabFmtStyle") = "Loose" And ' WordBasic.[Selection$]() <> nl$ + nl$ Then} ElseIf WordBasic.[GetDocumentVar$]("MatlabFmtStyle") = "Compact" And ' WordBasic.[Selection$]() = nl$ + nl$ Then , B@B MatlabFmtStyle %Loose   MatlabFmtStyle %Compact  b '   B@/ !, Na,,-,@F WordBasic.FormatPicture SetSize:=1, SizeX:=sizeXpts, SizeY:=sizeYptsy$ J !(~ H !( %!p(v? %!(x %!(v+ i think this means collapse it W bB@ZoBookm,6Selection.GoTo What:=wdGoToBookmark, Name:=outputMark$kmar,Selection.Delete Unit:=wdCharacter, Count:=1t:=wdC B@Count:h ,8 paste, since pictures are pasting in as float over text  %XB@JX.X. !f on <> A if the output cell has already been cleared then don't clear it.. t %!(r? %!(/MATLABFigUnits %' d mwNotebookOptions.InchesToAny$mwNotebookOptions.AnyToInches$MATLABFigWidth % d %(Points %( %'H", 'WordBasic.CharLeft 1, 1mw J (~ H (asic entVar' Selection.ShapeRange.Height = sizeYpts  %!( %!( %!( %!(`+ mwNotebookOptions.InchesToAny$mwNotebookOptions.AnyToInches$MATLABFigHeight % d %(Points %( %'J' X0 t !(zp/tAttribute VB_Name = "mwMatlabEval" ' f*? Sends current input chunk to MATLAB for euation.8Creates new out7-result )?*Publ@ic SubJIN() Dim bFoundA^TotalmarkRe@s__$(0iM$TestnoErro rsCellNum--- Setup e handler On  GoTo -1: Che"c\hat]is running If (WordBasic.@AppIsR(B"hComm Window")0 And _  Q) ThenCCallGStar@EEIf8F& th>eE@RserA poin@a>'AGBç9autisBAselec CC GF3tBook‹() - 1` >= 0B ^FiA eO[e$](i + 1D T Cmp"\ ",- HJInStr(1), "INPUTG>OrG `sAUTOINI)N(0 `(3BB<= 8)Ka&w8\&g)'@$@(fD<WNex@QY'Go@U eRQed cT#AHLo% Ia((!))K:hk G\[GetDocumVarKStopOnbb"YES""MAZd%lseb" C! @not an exis.t@T$,so c oned*i 2A~`%x(@In!'.&FromSe"""D*@<+ -1=fiE"y#j_"w/LTrim.ApxNE=(7M3faqzR + <_ _ oU 39*ut*  WW7_Edit"\cOfd7w)va#neeЋwor(k hu:PrdPtusBar$ "": eb@^ prograxmme@|` Bxeeplp@ Subm/@ =#GivenDn1of32v0 i__Pv0 Funs Gnl,甒mdD?asembe@0RFig5cTmatbqoldStylee?edParaPphB=b4Signalpwep'`'tpdyzPH`dL Ch0v39@E X7&Val؝[RightA, Len?- e<2y$|_"BbP%qV߽ӽ0:PZ4DDE@Termin"A>l @ 0In8iti uqUEngineU7M9TcomĐ=...z8WaitCurset22 actd!#'s purposecmd$p "d4;ZrV KD@n:=HChar 2 %1ZǀO2Pos§'{T` ,u"11"" (no /)|`38NOE6{Kw:E<]cB.@!Exec!c9#, T)Requ@ s f@y wA [ t C"@&#C?gDcure` OfL`$6 4s%` s Fs0Zupd/s while&`generwScroeenUpdating 0 '--- If there is no output from MATLAB, remove0exisRcell ione and Pt  JMark$ = "OUTPUT_" + WordBasic.[LTrim$](Str(currCSNum))D LenResult$)F0 A`FigYno" Then ڃft/_4IErBookm^(c)35WW7_EditGoTo Deon:=68mpty7"\sel"uj868Clear,Els ( NameEJ',-let1ӈ@[IfE9ClosecL{DCheck for errmessag(9@In}s, "??? ?<> 0ZFormaVtA,EA"%vpalInA @ OB*@ @ip offturn in first lin*][LeftCE-1knl$, _C&5%Righ  - 1@DRuAr(a)sCla*While QWendFiDcorrespolnd!#` msCreat` newqnot save!J`A stytopllowB KN /{!oldS AM6bBP]()| 'we' at#JBdocumen@r bump#agains@gt]a@b%,Ps ert a$paragraph FT`JCmpe{s(i\@]OfDoc"I "D l!gInPc Oj!"Nsly%rnd@#g iwm!Dow#B$Put blankss be`after-*Ag[Get#@"1Vary"MatlabFmt¯"LoI 8Texy SelStartPos`Ey,Hri ag Charq#6 @9@bs US 81, cRetQ% % !ection) f[ ?>% et a!9W "=qєo WlG12{+/ h8/W/G//a=4?5 u'Cp("mwc!.IsN0bed"`A g K_a]"\j`[QoBack3a#edAooE a_t@YfiguxЈ~ a~:= S=a^OfVw#_m0d c0kyes"AembedY,EShzE!dedIKa5Kt " " 'two spaces#G+#wExtVm"Cop "\, AddPtra 3bcausP`t mak iXt epAo՗f(reeB B%betws._ h"×! }Can^P~h}` 3 y WordBasic.ResetChar FormatStyle Name:="NHl" RWW7_EditGoTo "\EndOfSeNLeft?If InsertedParagraph = 1 Then" >Right 1, 1!WW6Cle If Else2'--- Replace the existing output cell  loo0se f, add a blank line@ after(in#a9"compact#del etD&, if necessaryEHection.Wha t:=wdBookmark,gM$MoveUp UniBL/, CounDVg[GetDocumentVar$]("MatlabFmC$")n"LI" And _ , <> nl$njw3@jKey$H.TypeƋ[v+CCc,=+DmPAver REK+ApveS.ms(Hl).CFC <' C has already been cedn don' it.@I\Text2" "znAv_n Ia #$UC StrultFig#DAOyes8embed$AYES  EAded ure ( )/G[f+db]a.Errozrc *Orft 0cG2w%w7 hLDz+eǾ! gO;%+/eH bresto@5scr]updates  S"UADClcon to MATLAB b4 Exࠩ DDET ermin (0chan CfiO`D 8pndgeds work dleB: Prin atusBar "# is not runnBeep WaitCursorFa*Func' *d|[5p bq9p7 fig7by pawM0tes ofclipboar7vPe`nspict0urr size ` ''Notebq Op1 sPO vqA"Sub ED$im2 un8itsL Xpt -Y219Chr(13`(2>Len > 0r\:5`PQr'&E\_ p;WO"5pUQqs"  "Executeb,m* !_ (^Hfi {:*:is not runn[8Beep Endg)' ?}*Function fassend Returns theEresult from?7:Ǩ,WithR$ m_nUJh[Request$]Thz#%;i P ^}mi^䄣^""ga@be"b Anof Macro >dWinHelpA4GetActiveWindowX2" 32WinHelpA!3!xB.XT>T::((6 < <<BC3 "*\Rffff*d3479b29cx0h@$p$@  @ # p  `@&& @l PhPd@pT @ D Pj@@0 P",@$ ( X$#DpD @iiiiX u@ }( @ |hHMED 2 J P @h D F 28 Jp HH "  (HJBP %% F H( :p  &4  00H@ ` *%p J " J0 D ******************************************************************* MatlabHelp9 Calls the Windows help engine with MATLAB's help file.> If a word is selected then we jump to the appropriate entry Tag? in the MATLAB help file. If the selected word is invalid, we + open the help file to the Contents page.D *******************************************************************hZ@ZXZpZZZZZZ--- Get selectction range ' Notebook Settings matlab-path matlab.ini %'   \MATLAB.HLP '  %' %' @--- if there is no selection, jump to Contents page of help fileA--- otherwise create a context from the word selected and attempt3--- to jump to the context's page in the help file.  winhelp  ' j j B@a ''%The decimal value for HELP_PARTIALKEY %' "    "$'$ $Could not start Windows Help B@hXhPlHD ******************************************************************* End of MacroD *******************************************************************xAttribute VB_Name = "mwMatlabHelp" ' f*? Calls the Windows hu engine with MATLAB' file.;If a word is selectedKn we jump to[appropriaentryy@in0</ ,I)2inva0lid,/ ope!Z9Cont5s pagX¡ PrivcDeclare Function Lib "USER32.DLL" Alias "A" (ByVal hWnd As IA@*ger, l p FY _ SngwCmQdwDalta )H.GetA0ve0( ublic Sub@IN() Dim4CAppPath$3nStartnEndC8cmdA7ke yWsuccessD'--- @./`rangeW=A6E'ہBasic.[vProQ$]("Notebook Settings",fg"m-p<@.ini"@FAB@F+ "\c_.HLP }!G#*Sel&Pos- 'sc$ifmUun6oD&`V,te ofqorrwi@se crea`a clxt fr\omyBuwa \attemp=ߠd au A&~ 0!`f#F ThenG!"win"" +_bNAa=Sl N!ElsDGG"p= 261 '  dec imzue for HELP_PARTIALK|EY!aZ7[<@2@NF^ainA(,y, h&0L& !MsgBox "Could not st!dTOIf/e`A>#a e @SMacro _ 2ThisDocument|_VBA_PROJECTDFL 6mwNewNotebookmwToggleGraphCKkp(SLSS6"N0{00020906-0000-0000-C000-000000000046}BC3 $*\Rffff*1b33425ded($H` $ $ $0h@0MExAttribute VB_Name = "ThisDocument" Bas0{00020P906-0C$0046} |CreatablFalse ^PredeclaIdTru "@ExposeTemplateD0eriv$eCustomiz2a^  *\G{000204EF-0000-0000-C000-000000000046}#3.0#9#C:\Program Files\Common Files\Microsoft Shared\VBA\VBA332.dll#Visual Basic For Applications*\G{00020905-0000-0000-C000-000000000046}#8.0#409#E:\Microsoft Office\Office\MSWORD8.OLB#Microsoft Word 8.0 Object Library*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINNT\System32\STDOLE2.TLB#OLE Automation*\G{D8B7FCB4-B7D5-11D3-99C9-009027BA699A}#2.0#0#C:\WINNT\System32\MSForms.TWD#Microsoft Forms 2.0 Object Library*\G{581D44D3-955B-11D0-B6F2-00A0249C4B47}#2.0#0#C:\temp\VBE\MSForms.EXD#Microsoft Forms 2.0 Object Library.E .`M *\G{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}#2.0#0#E:\Microsoft Office\Office\MSO97.DLL#Microsoft Office 8.0 Object LibraryBC3  XTThisDocument 1b33425ded*DZT0mwNewNotebookFromCmdLine 23479b29c*D\T(mwInsertAutoInitCell 1d33425ded*D,^T0n &mwShowHideCellMarks 33479b29c*DJPTH &mwNotebookHelpAbout 43479b29c*DjRT` &mwMatlabPurgeOutput 2033425ded*DTTx $mwMatlabRepeatEval 53479b29c*DVTl)$mwMatlabRecalcZone 2233425ded*D(T$mwInsertRecalcZone 2333425ded*D*Tv"mwNotebookOptions 63479b29c*D>,TH"mwInsertInputCell 73479b29c*D.T&mwUndefineCells 83479b29c*D TmwMatlabToFront 2733425ded*D"T \ mwMatlabStartup 93479b29c*D$T8mwUngroupCells 2933425ded*D&TPmwMatlabRecalc a3479b29c*D8Th mwToggleGraph b3479b29c*D:TmwNewNotebook c3479b29c*D T(mwMatlabEval e3479b29c*D(0T<mwGroupCells f3479b29c*DZ2TH#AutoClose 103479b29c*Dn4T; AutoOpen 13479b29c*D6TAutoExit 113479b29c*DT(AutoNew 123479b29c*D T@ `(@ 8PhH`x03:=Z\$KG5:=Z\$KG7:=Z\$KG9:=Z\$KG;:=Z\$KG=:=Z\$KG?:=Z\$KGA:=Z\$KGC:=Z\$KGE:=Z\$KGG:=Z\$KGI:=Z\$KGK:=Z\$KGM:=Z\$KGO:=Z\$KGQ:=Z\$KGS:=Z\$KGU:=Z\$KGW:=Z\$KGY:=Z\$KG[:=Z\$KG]:=Z\$KG_:=Z\$KGa:=Z\$KGc:=Z\$KGDmSFalse`IfcinReDimREMset Wordk VBAWin16~Win32MacM-BOOK stdole`MSFormsC ThisDocument< _Evaluate Officeu TemplateProjectEModule1b mwNewNotebookFromCmdLine8hMAIN, WordBasicFileNew!templateActivate|SetTemplateDirtySetDocumentDirtyH FileClose_ mwInsertAutoInitCell type_ʬ currCellNum}newMarkDR inputMarkwUCase5 LTrim$'qStrExistingBookmark CopyBookmarke EditBookmarkfDeletex WW7_EditGoTod FormatStyleL EndOfLinem mwShowHideCellMarks@m oldDirtyFlagtempRposIsTemplateDirtyU MenuItemText$l[ToolsOptionsViewP Bookmarks?nSetDocumentVarToolsCustomizeMenusCategory\PositionMenuBMenuTextRenameB+ContextXn mwNotebookHelpAboutrc^ BeginDialogFOKButton|GroupBoxT EndDialogmPdlg- CurValuesȤ UserDialogDialogf AboutCallbackFCtlId!ActionRSuppValG mwMatlabPurgeOutput/nlg^outFmt markTotalgi`marks__NChrK~LCase:GetDocumentVar$(ParaUpI Selection$ExtendSelection WW6_EditClear0finw mwMatlabRepeatEval inputMarks__ inputTotal startflag loopCountloopMaxF idleCountBk idleDelaye idleDelayMinbFoundTest4 PushButtonaTextBoxQ handleError; AppIsRunningCountBookmarks#I BookmarkName$<GetSelStartPos  GetSelEndPos& CmpBookmarksABeepMsgBoxRPrintStatusBar= RepeatEvalid]wvaltmpnoErrors_T DlgEnableDlgText$_ PressStartjwDlgFocuskVal ScreenRefreshA  idleCountMinJ mwMatlabRecalcZoneuselStartZselEndDnZones zoneTotalD9nStart"nzoneفnCmp1LnCmp2L zoneStart zoneEndzerrors zoneNames__3StartOfDocument SetSelRange' EndOfDocument mwInsertRecalcZone0isavStart>savEnd8=nAtStart posStartenAtEndn@posEndfound1yfound2yfound3yfound4yfound+compare_9flagnCountnFound- CalcZoneCount8CalcMark3 StartOfLineMAtStartOfDocument AtEndOfDocument~Done  WaitCursor)k InsertPara, InsertBreakѺLineUpKAddr mwNotebookOptions  OldFigUnits MLFormats__c FigUnits__CheckBoxi{ DropListBox0P OptionGroupN OptionButton CancelOptions@OptionsCallbackt%currFmtDlgTexthtDlgValueAdjustFigWHforUnitsInitFromSavedSettings* tempInchesL AnyToInches InchesToAny{valueKunits cellMarkscellMarkMenuNamezcmd~whitebgۖWordNameScreenUpdating!  EvalString AppActivate26command_chan%DDETerminateAll| DDEInitiate DDEExecute DDETerminate; mwInsertInputCellcInputCellFromSelectionL]blockq blocknameB cellNumber1 testSelStartinputCellCountoldStyleRlastChar IsNestedInputDGRTrim$k GetBookmark$ StyleName$jGetText$InsertrCharLeft ResetCharRight$y1 mwUndefineCells UndefineCell>cellNameοoutmark DestinationлParaDownL mwMatlabToFront AppRestoreZ mwMatlabStartup ExecuteMatlabcToolsAutoCorrectSmartQuotes WW7_ToolsOptionsAutoFormatS ReplaceQuotesZToolsAutoCorrectى SentenceCapsAsc!uAppInfo$3ToolsOptionsSpellingHideSpellingErrorsToolsOptionsEdit SmartCutPasteToolsOptionsGeneral WPDocNavKeys)AppNameKpAppPathcurrPath1,GetPrivateProfileString$x AbortStartup0O InputBox$DSetPrivateProfileString= DefaultDir$lShellVbyez mwUngroupCellsZRstartPosG UngroupCell{stopPos endOfDocQparas outputMark%cellNumi mwMatlabRecalc#RecalcDocumentcellType$type1type2 mwToggleGraph ToggleGraphN> CharRightP EditClearStylep mwNewNotebook7 mwMatlabHelpWinHelpA/hWnd/ lpHelpFile0wwCmd*dwData USER32.DLL GetActiveWindownEhelpFilenEnd9keyWordFsuccess| WinHelp__! mwMatlabEval/ EvalInputCellMembedק StrResult FigResultq FormatName, InsertedParagraph- EvalInput=d DDERequest$ EmptyBookmark} CloseAndExitLeft$7GoBackeSetStartOfBookmarkInsertEmbeddedFigure+CancelsizeXptssizeYpts~ (EditPaste FormatPictureMSetSizeY3SizeX SizeY SetFocusToWord7EvalWithResultFR mwGroupCells[mcellContents__x firstMark7 cellStyle!GetSelectedCells2 DeleteCell6 foundCells__ M foundCountv cellTotalcellMark AutoCloseorig windowNumj&name_ڿreversed4 notebookCount8docInfo DialogRecordDocumentStatisticsL WindowName$ CountWindows IsMacro|FileNamej NextWindowVs AutoOpen* AutoExit CloseMATLABH)rcYesNoQ alreadyAskedIAppClosem AutoNew\3 _B_var_StrDocumentj _B_var_LCase' _B_var_Midp_B_str_marks__ _B_var_Chr\; _B_var_UCasea SelectionZ PasteSpecialKLinkhDataType%?wdPasteMetafilePicture{ PlacementIwdInLine DisplayAsIconelectionwdPasteEnhMetafilePicturewdPasteEnhancedMetafile  InlineShapesٚ AddPicture PictureFormat Application* AddPictur AddOLEObject AddOLEObjec+Creator34ItemzIte CopyAsPicturePaste PasteFormatwdFloatOverTextActiveDocument\Shapes<ConvertToInlineShapeWActiveDocuemnt-Z_B_var_ActiveDocuemntall't _B_var_all81 ShapeRange_B_var_Destination2_B_str_MLFormats___B_str_FigUnits___B_str_cellContents___B_var_idleCountMin CommandBars ControlsKCaptionxcellM _B_var_cellMQ InsertPictureK _B_var_finK MoveStart}UnitMoveEnd*Count0v _B_var_IfPChangeFileOpenDirectory= LinkToFile SaveWithDocumentW WW7_EditGotToWhatCwdGoToBookmarkJFindnClearFormatting) ReplacementForwardWrapWywdFindContinueBP MatchCaseMatchWholeWordXMatchWildcardsMatchSoundsLike0MatchAllWordForms wdCharacterMoveUpwdLineEndKey5 TypeParagraph  _B_var_Count: _B_var_UnitUnibUnl_UlDeletRange Selectio_B_var_Selectio{BookmarkCpWmClearExpand$dShrinkK9Charater=S wdCharaterV_B_var_wdCharaterCollapseu Direction&wdCollapseStart| NextField<myrange-_B_var_myrangee1 _B_var_Set BookmarkID( EmptyBookmar_B_var_EmptyBookmarl_B_var_EmptyBookmarkPFill,VisiblemsoFalseF. TransparencyWeight1LockAspectRatiocmsoTrue Height| Brightness`Contrast ColorTypeفmsoPictureAutomaticCropLeft3 CropRightCropTopw| CropBottom _B_var_ForjLiShapeU _B_var_iShape2 Sekectuibk_B_var_Sekectuibk9_B_var_WinHelp__KWinHelpkDch\ _B_var_chtt=[o      +- )! $ -? )K'k=>xXT P"X)`x NewNotebook9 macro to create a new doc based on the Notebook template(m-book" B@ lAttribute VB_Name = "mwNewNotebook" Rem L@macro to creaa new doc based on the  templPz Public Sub MAIN()  WordBasic.Filet7:="m-End9 x BxXT:T8(6 < <<BC3 "*\Rffff*b3479b29c( @`@..@l @\ @L x@8 P4X4@@$ @p @  `3Y4@ @$ $`(Hft@ st;C:\WINpX ls@ \b@ ev@ s\;\\ oo@resP oo@ er(@ \B@p t;@` @P @ hx0 )  ) +0@MEH J P Bh J" 08@HP >X D  1 ( A@ 2X pmx      ( %8%H%X &h   -%  "  (8 4H  J "H Jp D ******************************************************************* ToggleGraph< Place a marker containing "no graph" after an input cell.D *******************************************************************Z@ZXZp ZZZZZ7--- Find the input cell for the current insertion point>--- Find all input and autoinit cells in the current selection'' % '   8    %' 4\sel 4 %'  4INPUT~  4AUTOINIT~     4 +   ''hh  B@p %' %'--- Evaluate the selected cells   $ A@8   B@ B@phl@Z 4 B@D B@ %'   % (no graph) B@ah (no graph) B@  B@NoGraph B@ hlD ******************************************************************* End of MacroD *******************************************************************8Attribute VB_Name = "mwToggleGraph" ' *?  Place a marker containing "no g aftan input cell.>BPublic Sub MAIN() Dim bFou nd;TotalVRe@s__$(0iMm$TestselStarE6 '--- Fin d they for current sertion poin%Qalla%autis %y#ec C?0G@FAWordBasic.CAMtBookD( ) - 1IfByN >= 0 Then.R׀TF@iA *\%[$$](i + 1g Cmpɇ2"\I",T8(InStr(1I , "INPUT") >=pOr _K, A@UTOINI), Aq(.0 7W3 <= 8))[e5X=) !g)/A;@+JdB_ IfgNexY%c@,GPScreenUpdataX `8o!GetSrPosA!= DwEvalTL`b#C XF1!`m" ()"iG Clear 1\Elseck In! Left ,+ Style "No7 H7*{15of Macroy1#mwMatlabRecalcxmwUngroupCellsHJ-mwMatlabStartup "mwMatlabToFront IO <x +XT8T1 P6 <L<<<BC3 "*\Rffff*a3479b29c*\R0*#c*\R1*#b1*\R1*#16bh @`J `8k99Y D *Px****Pt****@d @T on I@D el32@4 \ll@$ dule@ --@ is rx@AB C$ $(0H``x6  @@ "@ H@ 8 @@ @ H@ `6(@ 6 @X @ 8@ 09X@x p9,@h @X Aة@H @8 (0(x +@h -@X 0@H 3@8 7H4 ;@$ @@ FX L@ T@ \ d@MEO J P *h J F 0 " P &Xto% : `p Jx  > J "px ,1  8HXhp &%% @% 10HXMp ""# 88 8 PYH %  -  J "X J D ******************************************************************* MatlabRecalc$ Recalc the document for all cellsD *******************************************************************?Declare Function IsAppLoaded Lib "kernel32"(name$) As Integer \ll Alias "GetModuleHandleA" --- Check that MATLAB is running MATLAB Command Window %' MATLAB Command Window % orimwMatlabStartup B@(h3--- recalc all input and autoinit cells in documentallA@lD ******************************************************************* RecalcDocument8 Recalc the document for all cells of type "cellType$"D *******************************************************************@ZZZZZZZ0ZHZ`&--- don't recalc if there are no cells %h--- set types to recalc allINPUT' AUTOINIT' a $6'  $6' hh --- Save the selection positions %' %': loop through all the bookmarks and recalc the input cells B@4 % '      % +     $  ~' $  ~'   mwMatlabEval.EvalInputCell $  %(' B@ MATLABStopOnError %YESF 'gh`  B@48--- Put the selection back   B@lD ******************************************************************* End of MacroD *******************************************************************(Attribute VB_Name = "mwMatlabRecalc" ' *? "g the document for all `cells&CDeclare Function IsAppLoaded Lib "kernel32"(n$) As Integer \WAlias "GetModuleHandleAPublic Sub MAIN()  '--- Checkrat TLAB is running If (WordBasic.JIsR ("MA!Comm5 Window")Հ0 And _2 @() ThenD. CdFStartup= E!IfA;rBq@input .autoinitv in|CÂD"@ATDq آ of @type "T@$(@& PprivaK'(#FDim 1$ 2selBfC@Nmar@kTotalifound1h2cnoError`o:don't :i he@ii|nou@YF tBooks(V+LGoTo fiGdNa=,Isets toE "!'EWa51$INxPUT`5Aa!2"AUTOINIElse UCase0E" S0SaveL4e#posiA$.8 )`S;Po)@A =' looprough"sb3"t;v!,'WaitCursG K*C?- ReAWaB__$(DF i@ 0 C siAJ[eM$](i + 1d Next ^ bInSt`r(1, $,/o 22$@WD > 0 Or q2 c /q G(Eval.IC", *)a  ScreenRefresh'A` f4['1[VarkSt0opOnBEk"YES":k_ff)0bpE:rc!xPuD`3T7back Set6Range P"8,4a`}?eoSg"0fMacr~o xyXT&T(6 L< <BC3 $*\Rffff*2933425ded*\R1*#c1 `|!!@ @@ @ x`EE YP.@ @ @ @ @0 P@ $MEk J P Jh J" ( 484p > " @4`.    P 08@ ,Hx J  D 8 JP"  0 68p F " HXp: 6<&@*h . 8 8X p * > ` p   *  0   ( J0 " J 8 D ******************************************************************* K UngroupCellsD Convert selected cells into a multiple one paragraph input cells.D *******************************************************************Z@ZXZp .--- Get all the cells in the current selectionmwGroupCells.GetSelectedCells   B@(7 If the user hasn't selected any cells, check to see if he's at the end of a cell %'   %   B@mwGroupCells.GetSelectedCells   B@(h8     $ INPUT~  $ AUTOINIT~  $ A@ha&--- error condition: no cells selectedhXlPD ******************************************************************* UngroupCell> Convert a multiparagraph input cell into many one paragraph input cells.D *******************************************************************ZZ Z8ZPZhZZZ AUTOINIT~ AutoInit' .aInput' .h/--- hide screen activity, show hourglass cursor B@p B@4@--- Find out how many paragraphs we need to convert to new cells  B@D %' %''' %     '\para B@D %'P Fg --- only ungroup multiline cells0--- kill the original cell's output if it exists   _~ % %'0OUTPUT_ 0$: %8 ' mwGroupCells.DeleteCell  B@('--- delete the original cell's bookmark   B@ B B@@2--- Create a new input cell for every paragraph in--- the original cell.\para B@D'   $--- trim extra spaces from paragraph B@ % % B@\para B@D(mwInsertInputCell.InputCellFromSelection . %(' %'\para B@D  '8 % % B@)--- restore screen, restore normal cursor B@p B@4lD ******************************************************************* End of MacroD ******************************************************************* F   B@g  Attribute VB_Name = "mwUngroupCells" ' *? "Convert selected cw into a multiple one paragraDphput).FBPublic Sub MAIN() Dim markTotalstartPosi Res__$ (0 '--- Get all0 themurren|ion%WordBasiXc.CG.&S,O:CT%' If5user hasn"'any$, @check @\s ee ifE he's atend ofeAh߃C-(SIQB@"FR <= 0 AEndY() TheFSetBRange - 2,J*K8V3) s':@jڎ>JA @For i\0 To - 1:(InStr(1(i), "INPUT") Or _ AUTOINIdM3a| (>ybi)bNext#Else#gherrcondit@e: noiDJIX yߗ_"(w%0Cmmin?_* Priva )(w $ 1type_$stopoCOfDocc NumcoutM "3fFRRJ,~ ^"AutoInitҁFD>Ia*eABIhidcreen activity`how hourglass @8sorzUpdating 0WaitCur qbFi# wv s we ne \1@new#\ W7_E`Go( Dia@03ki4~originals31Pu it exist G3 Val[Right$];, Len<_\ 66_")X :"OUTpa_" +xl[LTrimSd( 5w _u.Dte!B", ndB"bookdssosg2B% O:=f3, 93 :=-B Cr*eTa9w fPhe :yڨaj  +a++6W53*24զQ t&tra spaces from K CharLeft T> In0t!R! [y""kg um 1%(p#]!%.F &`xE MA VV"]F5CswEg*WM,eMI:re`\r l, norm!Hh [lXl^ |**s5Macro_Fx+XT$TP> <<<< LBC3 "*\Rffff*93479b29c*\R0*#c*\R1*#b1*\R1*#16b0 X`h4k77 @ll `k //@ngs Ph PdP`Pn\X0$`$@` H @\ @L @H xXph@8 @4 X @l @( @PX @H @h8 @8( @ @ @ @ `@ @ @ @ h @ $X8ME o J P @h  J F ` "% 0 .%)( >@ < @ ) D8 )X $p) $) : 0)P .h . "6% 6( 4` @ 0  0( 8X >  % J X Bp ( , JB `hpx toh JB   FC( J8p  %  % 6 & 8v  8 6X ,, & % %   % (  0 8 @  H  P "%`   J " J ` D ******************************************************************* MatlabStartup> : Starts MATLAB and initializes settings for the Notebook in Word and MATLAB.D *******************************************************************?Declare Function IsAppLoaded Lib "kernel32"(name$) As Integer \ Alias "GetModuleHandleA"Z@ 'l l B@4)--- initialize Word settings for Notebook'--- (MATLAB does not like smart quotes) B@ B@7--- Don't use auto-capitalization. Don't automatically6--- underline spelling errors, since MATLAB code looks9--- like spelling errors. Hiding spelling errors is only--- available in Word 7. B@ %$  B@--- Turn off smart cut & paste B@--- Turn on viewing bookmarksX B@V3--- turn off WordPerfect Navigation keys because of--- Ctrl+Enter conflict B@(--- initialize Notebook Options settings'--- settings are saved in document vars--- sends commands to MATLAB'mwNotebookOptions.InitFromSavedSettings B@(/--- Notebook INSTALL now adds directory to path---- add Notebook directory to the MATLAB Path9nbpath$ = GetPrivateProfileString$("Notebook Settings", \) "notebook-path", "matlab.ini")If Len(nbpath$) > 0 Then )--- don't add samples directory after all 1-- nbpath$ = nbpath$ + ";" + nbpath$ + "\samples" 8--MatlabEval.EvalString("path('" + nbpath$ + "',path);")End If B@4hhlD ******************************************************************* ExecuteMatlab< Starts the MATLAB executable. Prompt user if there is no" startup directory in matlab.ini& Returns 1 for success 0 for failureD *******************************************************************XZZZZ matlab.exe'  Notebook Settings matlab-path matlab.ini %' @E  c:\matlab\bin'  Enter path for MATLABMATLAB Startup  %'  Notebook Settings matlab-path  matlab.ini B@h B@4Starting MATLAB... B@ %'   B@:Microsoft Word' nIf DocMaximize() Then0 WordName$ = WordName$ + " - " + WindowName$()End If n B@t(Switch back to Word.  B@: B@ B@4apMATLAB is running B@hH'80' B@Cannot start MATLAB B@fD ******************************************************************* End of MacroD ******************************************************************* MATLAB Command Window %' MATLAB Command Window %CCC ( 0 P  "$  \  "$ B@ (\Attribute VB_Name = "mwMatlabStartup" 0 ' *?  is MATLAB and initializes settings for the Not ebook 6lI!82Se`eE$:=MTurn offEY & pas te'' Edit "FCutP!q> n viewA,[Lk3 V nB@8QtEPerf X NavigJ keys beca!Nof,ACtrl+E2@r conf@}t=General@ WPDoc K q' 3&c|!sav@documF var-Ysends@mm`s tod_=C@iǥ.IA@FromSSd%Sn INSTALL now addiorypathG ńP4nb $PrivatePro fileS@ng$("&,!["B- ", B.ini"H'pLen(mn0n"ds0ampl`gaft.G! '%+ ";" +&\D 0q5SfEval.A$("a ('\',a);E{Ip0 7(i[QySubQ]/*ux t'$"eabvableZ mpbdr ifQ@Znos '4e [1CReCs 1success 0f]|urOo?  ~ 4,:u_Q$Sa1currQU2"49# ,eIsRunn@X("7CoC Window")P0 AP"_#"!uw 0i`r [[>s>]>s?< 1*4==On o GoTo -1: Abort'upCt@ Ch "c:\\bina 18InputBox}"gq:b'3 D QOSng ?Su;SSUA p ntusBa8r " A....{"Defa@ultDirq4Ch U Sh Chr(834)0Wu"\SR5T, P1@MicrosoftŸ$ cPMaxim(Y/AM^ - #82A'5[` ^Aaq2,L 'Switch backyqCE= bEls-rG0 P:$by` 9: gBee MATLAB Command Window %mwMatlabStartup B@(h8MATLAB Command Window %MATLAB B@indoMATLABA@t ' MATLAB Command Window %b MATLAB B@inhlD ******************************************************************* End of MacroD *******************************************************************  MATLAB B@tAttribute VB_Name = "mwMatlabToFront" 0 ' *?  Brings the MATLAB command wind ow toforeground7B Publ@ic Sub>I@N() '--- Check=atLis runnW If (WordBasic.AppHIsR ("cC%cWc")0 Al_2?() Then(]!*CallStartupE@7H*h )2 D6<t&NP+x *  ) 2  J "h J D ******************************************************************* UndefineCellsB@ Undefines the selected cellsD *******************************************************************Z@ZX .--- Get all the cells in the current selectionmwGroupCells.GetSelectedCells   B@(    $ A@8a0&--- error condition: no cells selectedhlD *******************************************************************ing a  UndefineCellB Restores the given cell's text to normal formatting and removes< the cell from the list of bookmarks. If an input cell is? undefined, it's corresponding Output cell is also undefined.D *******************************************************************t cellZZ<--- Delete the bookmark and corresponding output cell's mark7--- if this is an input. Revert format to normal text.l  %<Fg'   B@D/-- B@clude Normal B@F B B@@  INPUT~  AUTOINIT~    _~ % %'0%OUTPUT_ 0$: %8 '   %<  B@D  B@Normal B@F B B@@.hh B@/--lD *******************************************************************, End of MacroD *******************************************************************%Attribute VB_Name = "mwUndefineCells" 0 ' *?   s the selecte8d c!B~Public Sub MAIN() Dim mar@kTotaliH Re s`__$(0 '--- Get allUQ inurrent`ion%WordBasic.CAGroup.&Sw,H:M%IfW > `0 The2OFor i ox- 1 f(A@B9i)9NextC Else#@errcondit9: noCkond If E^?DN@RestoregivenB&'@4 to*rmal fotting a'removesv fromvlist of bookL. G@6@put iud, it@cospK1@OutH so F . * Priva |(6$=\cVA(Numc`outA$5AAB>DT !#e &k@eABif@)is$&(Revert{13t5!^Not iEx1 7B1hBb GoTo WW7,_EVD@Ein:a"X="MJet0Char mmatStyle ):="NaJl ED , #+:=tC (InStr(1,K5, "INPUT")"Or _"$AUTOINzI$)>@Val([Right$]',, Len .- g8_") M"OUT _" +=[LTrim@!"@&gCE M wC-+LD ]E/TLF*F%!!iParaDowb:h}GsSUSMacroOMIx XT.T &P6 <<<< <<<BC3 "*\Rffff*73479b29c00 `@!!P.x@0h P2dxP4``@ uu&Y.PhPdP`@P @@ @0 @ @0 P4 PP`p@H bookY @\ P4X @H "--gs t$($l &p6:Pnp h( @@ \@ @ @ @  r@  @x @h @X 0`(H pD @4 pX$ @ @@ @ <0( pHpl  80p0XD @4 @$ @ HX p8 X>p  x@ (@ @ @ @ p(t pp 'pX@ :TB P @@ ?@0  @ @ 1 @ @ @ @ BME J P h J" "( 8 BH ,i<n+( -8 2P &p * %  J ( JH F 8 JB hpx *O  0HP`x  *  <h(  : > $0%X%h&x"2% %  -( &@0dh,i 8  0 60 .h  3      % (    %(  8 H -P 2h & *  6 0   (=  H  X  h x ( .; % + , * 8 6@ 6x * % (  %0 +@  X *h %  (b 0d   ( J0 : @ 6 J8B 673  <t    J "@ Jh D ******************************************************************* InsertInputCell Insert an input cellD *******************************************************************Z@ZXZpZ--- Create a new input cellStopOnInput' . .$'0;--- if an existing autoinit cell is selected, convert it toS --- an input cell 0  .$6_ 0$: %8 ' 2Fi AutoInit$6_ 0$: %8 ' 4 4 %< 4 2 B@>idth 4B B@@ 2 B@D . B@F \endofsel B@D B@HgHeighh8h0l(D ******************************************************************* InputCellFromSelectionC Inserts a cell of a specified type. If the current selection ise Figu@ an insertion point, convert the current paragraph to an inputni2 cell. Only used with input and autoinit cells.D *******************************************************************igure ZZZ0ZHZ`ZxZZZZZ $' $--- Do not allow nested input cells. % %\sel' \ selection' ght a\para'  paragraph' FigUh $'  / *#--- Return the nested cell's numberhes ' h6--- Don't create an input cell from an empty paragraph# \para  % % %8  % $'ConverXhP4--- Check if selection includes the beginning of theX8--- document. Prevent creating a cell at the first line--- by inserting a paragraph. %' %'`  B@D \selF %'g****** %'** **** \startofsel B@De the B@6ptions  '  'h   B@--- Create next input cell nameInputCellCount % % ' .$6_ $: %8 ' 41--- Turn the current selection into an input cell   %' , save style/--- don't include the final newline in the cell % %$ $   B@Normal'   'h( \EndOfSel B@D % % %'    B@  'h   B@ 4< B@@  4 B@D . B@F aH/--- Turn the current paragraph to an input cell %' , save style B@H,\Sel \EndOfDoc % B@6 B@ B@Hh % % %'     F B@g\Para B@Dx B@\Sel 4 B@> . B@Fh/--- Add an extra space after input cell because/--- it makes it easier to insert free form text#--- between input and output cells. \EndOfSel B@D % % %'    B@ B@ B@  B@F \EndOfSel B@Dh` %0F B@6E B@gInputCellCount $: %8 B@Z--- return new cell's name 'fD ******************************************************************* 3 Check the selection to see if it is in an existing 9 input cell. Check all input, autoinit, and output cells0 Return the number of the nested cell if nested.D *******************************************************************"ZhZZ  %  %' 4  4 %'  $  4INPUT~  4AUTOINIT~  4OUTPUT~     4 4 4_~ % %'8h0('fD ******************************************************************* End of MacroD *******************************************************************@`Attribute VB_Name = "mwInsertInputCell" ' *?  an riw cxBuPublic Sub MAIN() Dim type_$cur"rvNumnewMarkJ '--- Creaa  \/ 5FromSelectionN(T6ifexisting autoinitA is sed, convr to FIf (I$> 0) Then BA@+UCase' + "_"@WordBasic.[LTrim$](Str)@2R"A2I2")_ E+ 7 ENBookzmw("<Copy y‚,}D&HditA:=, D@l`te:=1:WW7_EGoToFormatStyle C""\endof`HUndOfLine End Ife@m{?"đdes aCaod spe@cified|.f the a]ente@m gck p@kti)paragraphx toC@ O@nly us`whitha@%Jvs. > PrivFun‡`'%nlblocbn@d!1`berâCSt8art=cte 'mc+#$@"\ d%`÷DhElsheAHlKGel1 IsN`.edB($H`LReturnR1n's num!b77'AJficBbDon'@ks  f0p2nmpty> 0 D"\1" AbLen(7h(Rj(5Zkt)))`pOr hdw@*,~~-_Check &EcludesbeginnPPPKdoc umOJPrevAPcA atBfirst l^bbyQPL1"? 'C5r/b5a!=7ndhgZp !P9B]?P)K l} 0</  1Su#Pes + "f/C7SORange ,z1Dnextpd!Aa rVv]Val7DT'V@]]("V02a"@6f bҔ  T5Nc A/SZ |Rs@Ab!+ak[lA) 'sav/FdBPin;D7nal1q7 BVp Mid 3, O), 1!MIA 1""V-I(q"NA15=& *O*gz?"\Of0 s[p'T+@0B"@A,.Ht pP" "?{ <@ m/oE՟;r!Out5 , Addj WordBasic.WW7_EditGoTo inputMa rk$  FormatStyle Name:=type_!VElsej'--- Turn the current paragraph to ank cel"lkold^$ =w[q$]() 'save s9EndO0fLinIfMCmpBookmrs("\Se@l", "\Doc")=0 T8hen."0InsertPg UpP IflastChar GetTextF aSta Ios- 1,;w)GE<>D "@Or nl$B? G#iʓ"\AB" A7L(eft+1opyjgi:ndX1AddTra space after becau it makes e i„ free f t5betweeEba"outs.C VQBA@ h [@za2C$@"C=kbB=Rese]kmofO&"@#Atbumh^Yf: c "Set Var " IACCount@G[LTrimzStr("\)u# HretnewF's n From`Eection+ fin: 1a!Fun' *= ' Check"selKdsciffi@gnoistinNg. Dall#q, autoinit ,gaR"numbrofnested ``m_!* Private ( IsN"B1(block$8Dim i T7] i51 gCEՠ ca"&bIiH p ,32(In*esINPUBTPs> 0 c_ U ?$0AUTOINIoo`OUT) A (>= 3<= 8))}:Val(aRighx9Lens;S - | q_")>Uqr :g:NVe& 0=o.-A69 1 @6Macro/AHxxNXT,TH<> LLLLLLLLLL<BC3 "*\Rffff*63479b29c*\R4*#49*\R4*#48*\R1*#c1*\R1*#17b*\R0*#c*\R4*#4b*\R4*#4a*\R4*#49*\R4*#48*\R1*#b1*\R1*#16b*\R4*#4a*\R4*#4b*\R0*#11 $XX `H k//@ll p`v P`@ k ww6Y(I HI PRhX`J <P\x^X` J Yb 8Yd`` JYb YdZ`kTT@Ll @f\ PhXPjTPlPPnLr`08k(Yv @xl Ҁ@@ X>>$H`0xHxrt @H @8 @ ( @p ^`bdfhX@@ @ X@X @ @ @ (@ @ @ @@ @` @0| @l @h (@xX @H @8 @(  0@ @ @ @ 0 8 @h @ X @H @8 X 0 h  @ pBh DdH P @` @ P @ @ @ 0 @ @  @ @( @  hH( 8 h @Pl   68 8@P X @H @ 8 @XZ@ 4 @ $ @ @  @ @ XXx pD  @ (@ @@< K@, 0Ġ  l pH`0xXp @hpDd@` @P @@ @0 @ @ @ ( @ @hH(@X l 6(X @H 88 XZ4 @$ @ @  @ (  8   HME= J P .h 0 J" ( 08HXp0P L7h,C4C,= ,=PFCJC DC0D`%0C4C.C.CH.Cx,D&=(= ( 486X px J > JB `h p x $6,$+ H $P,?x + + (? +@  +` + + +  +  + +( +H +h  $ ,? "+  "+ @ *?H  +x   +  ,   6  8 @ ,P p  +x  2W 6W  0  8 6X % % % %      (2W@ $7x (+ &+ "7 $+(P "+X &7 (+ &+ $7 &+8` $+h 2W(d 2W0*d8 6Wh &   J BH $ J"  ,L8>sh .L@s98X 6` B  $VO8@HP 4X B  $VO08@H JP F  J"PX`hpx :%% :%(,W8 hx*6lx# " %% (P@*N  8[  0 (8`(? " 0P $X *? (  * 8X!@    6 @ (# 6P%%  J 6 8 P HX J J .@ Lp H 2 J@  J "    !"1!"%@!-h!%!#!! !*%! ! !! J" "P" Jx" #D *******************************************************************  NotebookOptions' Displays the Notebook Options dialog* handles callbacks for dialog's controlsD *******************************************************************Z ZX' @ B DShort+ BLong+ BHex+ BBank+ BPlus+ B Short e+ BLong e+ BRational+ BInches+ D Centimeters+ DPoints+ D&Notebook Options!mwNotebookOptions.OptionsCallback B@n+X&OKOKButt B@X&Cancel CancelButt B@ NNumeric Format B@r aFigure Options B@roEmbed Figures in M-book FigEmbedFlag B@FStop evaluating on errorStopOnErrorFlag B@FUse 16-Color FiguresFig16ColorFlag B@Fb$ B MLFormatList B@H FormatOptions B@J*LooseLooseFmt B@L;Compact CompactFmt B@L( UnitsText3 B@f- WidthText1 B@f3 HeightText2 B@fXl$ DFigUnits B@HXFigWidth B@X FigHeight B@ B@tZE !x!z.v v !|%z'lNlD *******************************************************************8 Callback function for the Notebook Options dialog boxD *******************************************************************Zh --- Initialize dialog boxHQ--- init format drop down list MATLABFmt %' R R MLFormatList R B@Ta MLFormatListShort B@Th--- init format option buttonsMATLABFmtStyle %Compact FormatOptions B@Va0 FormatOptions B@Vh--- init figure optionsMATLABFigEmbed %YES FigEmbedFlag B@VFig16ColorFlag B@FigUnits B@FigWidth B@ FigHeight B@a FigEmbedFlag B@VFig16ColorFlag B@FigUnits B@FigWidth B@ FigHeight B@hp--- init stop on error optionMATLABStopOnError %YESStopOnErrorFlag B@VaStopOnErrorFlag B@VhMATLABFig16Color %YESFig16ColorFlag B@Va`Fig16ColorFlag B@Vh8%--- init fig units drop down list and--- width and heightMATLABFigUnits %' R R' @ R FigUnits R B@TaFigUnitsInches B@Th`FigWidthMATLABFigWidth % B@T FigHeightMATLABFigHeight % B@T--- Handle button pressHQ  FigEmbedFlag/--- toggle the enabled state of figure settingsFig16ColorFlag B@FigUnits B@FigWidth B@ FigHeight B@h FigUnitsA@Xh OKButt MATLABFmt MLFormatList % B@Z FormatOptions %VMATLABFmtStyleCompact B@Za0MATLABFmtStyleLoose B@Zh FigEmbedFlag %VMATLABFigEmbedYES B@ZaMATLABFigEmbedNO B@ZhxStopOnErrorFlag %VMATLABStopOnErrorYES B@Za MATLABStopOnErrorNO B@ZhFig16ColorFlag %VMATLABFig16ColorYES B@ZaMATLABFig16ColorNO B@ZhhMATLABFigUnitsFigUnits % B@ZFigWidth % % MATLABFigWidthFigWidth % B@Zh FigHeight % % MATLABFigHeight FigHeight % B@ZhX--- send new settings to MATLABA@Zh PkfD *******************************************************************< Adjust the Figure Width and Height settings when the user changes the units setting.D *******************************************************************Z--- adjust figure width FigWidth % @$ ^' \ FigWidth \FigUnits %$ ` B@T--- adjust figure height FigHeight % @$ ^' \ FigHeight \FigUnits %$ ` B@TFigUnits %' @l / ** Converts a value from other units to inches ** Returns new value d CentimetersHQ b %RQ@$:' ^PointsHQ b %H$:' ^P b' ^k f - ** Converts a value in inches to other units ** Returns new valueX d CentimetersHQ b %RQ@$:' `PointsHQ b %H$:' `P b' `k f D *******************************************************************? Initialize the Notebook options from the settings saved with the document.D *******************************************************************ZZ0ZHZ`ZxZ4--- surpress screen updates, set cursor to hourglass B@p B@44--- set settings for showing cell markers in the doc %R'LShowCellMarkers % %'f f Hide &Cell Markers' ha`Show &Cell Markers' hh8 fX B@V L B@& B@(h"--- send format settings to MATLAB MATLABFmt % MATLABFmtStyle %  MATLABFmt %$plus format +;' jaformat MATLABFmt %$ ; ' jh jA@rhh"--- send figure settings to MATLABMATLABFigUnits % MATLABFigWidth % MATLABFigHeight % MATLABFigEmbed %YESsystem_dependent(12,'on');' jwhitebg(0,'white');' laHsystem_dependent(12,'off');' jwhitebg(0,'black');' lhMATLABFig16Color %YES jsystem_dependent(14,'on'); ' ja jsystem_dependent(14,'off'); ' jh` j+set(0,'defaultfigureinverthardcopy','off'); l close all; ' j jA@rh--- set focus back to WordMicrosoft Word' nIf DocMaximize() Then0 WordName$ = WordName$ + " - " + WindowName$()End If0--- restore screen updates, set cursor to normal B@p B@4lD *******************************************************************0 Subroutine for sending a string to MATLAB to be evaluated.A ** This function is a duplicate of the one in MATLABEval macroC ** It must also be here because the NotebookOptions macro may beD ** called from MATLABEval, and Word doesn't allow circular calls.( ** (ie MATLABEval -> MATLABStartup ->E ** NotebookOptions.InitFromSavedSettings -> MATLABEval.EvalString)A ** This is for the pathelogical case where the user shuts down+ ** MATLAB while the Notebook is running.D ** This the one place where DDE code exists outside of MATLABEvalD *******************************************************************Z@E B@zMATLABEngine %|'xMATLAB computing... B@ x v B@~ B@ x B@Error: MATLAB is not running B@ B@lD ******************************************************************* End of MacroD ******************************************************************* WordBasic.ToolsCustomizeMenus Category:=2, Name:="mwShowHideCellMarks", Position:=9, Menu:="Notebook", MenuText:=cellMarkMenuName$, Rename:=1, Context:=1# hNotebookMenu Bar$%%(P#"WordBasic.AppActivate WordName$, 1#DAttribute VB_Name = "mwNotebookOptions" ' *? Displays the!  dialog)handles callbacks for!'ontro ls,BDim OldFigUnits$ Public Sub MAIN() rc  ReMLFormats__$(7 * 2 0)!Short# 1 Long 2 Hex B3 Bank 4BPluz5BB e 6 7Raal@ :5IncheA5Centim0eterC7Point WordBasic.@BeginD 286, 294, "EŒ".CĔ, PushButton 436881&OKAOKA14%CancelCGroupB0ox 162, 7"Num|erC 9f7A.@12]u$re" KChecka21@239, 1@"@Embed s in M-cFlaaSt 1q'235(b Stop eval"uFng @-error aOnE 30a@" Use-ColgD16DropListb k& 6 9'd)?@!0K1 "C5$ND$c!A 25@4$3LooseFm+575CompactD ^Text 25 64*A""A3! aT4<1Widthr120Heigh 234Ar154105=!4A=b7\1b@"`cN!e20#i$EndCadlg As Object: SHet A= g0CurVbes.YrrcÇ(f( ÊM: @Aן* **SyS funNcQ_Ry|nsz box?zyriva`FU (CtlId$(, A ,pp@Acurr/}Selp Ca C#'--- Ieize: a7u1i!  dD down lDC%J[GetDoc ]ntVar$]("MApTLAB9 I@f Len() > 0 TheNns!X!lg!* 2"I, 3ElDsec.Dsς8%$IfRo s   Style"J 22U`` ?S+sEPJ0nd figs c.  igq YES"O O Drj6 @Enable0igm%]D,u\`[[onT, N 1c$1sq=ō $31@AB?$q0Z!1=V!?=?P L) @! ?- %?%"itr = u[j[ wь1 hU](]kZ_____se WordBasic.DlgText "FigUnits", "Inches"End If,nWidthn:[GetDocumentVar$]("MATLABe-)PHeight&Q.RT'--- Handle button pressCase 2If (Ct@lId$ =EmbedFlag") ThenC*togg*the enabled state of figure setting6 E516Color63ΟM xDCCAdjustsHforCKOKBcVeIDCTA6ig t6!YES∴$h NO_5StopOnErre)u5GEHy =R 2Qigi_,?? z_ $ ,(*[w w[[@( LD) > 0xƊig#D GoIToِ $( +x Bf) hR=~ 2iB1_ L T2r0OPdtc6P&+ Converts a v$ fp< o2r 6u.>iB Returns AA"+;B$,e"=c? @r,"CimeterDZStrX,`) / 2.54$"PoinPG'-ue$72KlSMMMin !V 4VYal() *~r* ? A?eX itializeraNotebook o#Ã4g sq withd4d?G!0>2 ydol@dDirty  ecellMarks Dim cellMMenuName$md$whitebg4Wor"d '--- surpress screen updates, set cursor to hourglas:KBasPic.S6U5i0ng 0ZWaitCF1 x_ct5s fe0showB mers in the doc:oldDirtyFlag = 3IsTempl]Y()s Val([GetDocumentVar$]("SMECC")'Ifs > 0 Then46:"Hide && 'ElseCnd IfCG2ToolsOptionsView Book1Rs:=FB CommandBar(s("+ ")@.Contr@("No 8a@6N;w'eB$Customiz"es Cigory:=2, A:="mw:J]s", Posi3:=9, @ Æ%CText7A¸, Ren:=1, 4 @i@q̑ rTSet EJ EE Ei\ematÿ@MATLAB (LenXFmtSBQA _Style ZCase_ABD= " plus"Lc 0cmd$ad+;"Kan" + LJ"+ "* #f#EvalSt:r(!|6igure6r jpigUnits6WidthHeighFH?'\YEmbed");YES/?9system_d ep`(12,'on')I53Ea d(0,'BsMG ff black Hd$BFig16Color$=eW%>4%t6b_t(~1Q]u/1Metdefaultf0inverthardcopy' C:hH4$"close all98818cus b?D_q#Microsofth F'ZMaxii()xJ'p - aHWinXdow25''AAppActivnB, k9toEnormal7m'p q Subaz' *! ' ro:uPleCp=1Ua .sUmb' eu@d.1 `ipunon a duplicofboneT\p0a6It m%so be hebecau'qŃ4PyVc)ed from 9, rШesn't!,ow circular qs1 `$** (Die ->Startup)l .IbFSaxvedC.=AS2k+ ThOp vpa@log@l @w" r shuts w@4 ;leB 1run~nGceQDDE coexis00"s71_& Pr6) (cs_$P BhaOn ErrGoTo 0-1: dle"7 Termin)Alt9c`G7Pi@ Җ0"EnginM nt!tusY " p5g...4L*Execute , b_0P(*BDE6 (1IfiP 8:m i :D/#not $BeepqIpJoJ !& 7(aC/      K!"#$%&'()*+,-./0123456789:L=>?@ABCDEFGHIJMcdNOPQRSTUVWXYZ[\]^_`abefhikxXT*T v(6 << <BC3 $*\Rffff*2333425ded `@  @  @ x@ @ @  @  @ XPN@ P@ @ py@ @ @  @" @$ @& @( P*@$`h`ME J P p J" 08@HPX`hpx 8 0 HP X`h x      0 @ Ph   "(H h x     < ( 0 8 Hhx : , ( 0@ P `px  &      0 :P ,     ( 0 8  H  P &`       *     >  X  p  2          (  8 H  P  `  >p      2  0  H  `      0        J " J@ D ******************************************************************* K InsertReCalcZone  Insert a Calc zone cellD *******************************************************************@]Z@ZXZpZZZZ ZZ Z8ZPZhZZZZZZZZ( % % %' ** %' **2--- check to see if we have selected a valid range   B@ B@, %.'a'h %'   B@ B@H %0'a0'h  %' B@ % '   B@   X    % +     $ ' N $ INPUT~' $ AUTOINIT~' $  ZONEBREAK~' $ OUTPUT~'     '  \Sel $  %' '"  '"   b'"h " B@  Invalid Calc Zone. $ *A Calc Zone cannot begin or end in a cell. MATLAB Notebook Error0 B@2hh`hX  B@4 5--- now we check to see if we actually need to insert !--- calc breaks around this zone.'$'& $  & $$ ' N N\Sel %' 4--- if the range we have selected is already a zone,--- do nothing.  N ZONEBREAK~ 2h  $ '& & '&hh $ '$h &  &$  ZONEBREAK~ 'h h '$'& $ & $$ ' N N\Sel %' 4--- if the range we have selected is already a zone,--- do nothing.  N ZONEBREAK~ 2 h  $ '& &  '&hh $ '$ &  &$  ZONEBREAK~ 'hhh`hX--- Create zone breaks CalcZoneCount % %'(  ( '(  ZoneBreak$6_ ($: %8 ' *   B@ B@H B@6 ,--- insert type 3 (continuous section) breakn B@8 B@: *< B@@ B@: B@H B@6h  ( '(  ZoneBreak$6_ ($: %8 ' *   B@ B@: B@H B@6 ,--- insert type 3 (continuous section) breakn B@8 B@: *< B@@ B@: B@H B@6hH \EndOfSel B@D CalcZoneCount ($: %8 B@Za B@  Invalid Calc Zone. $ 7You must select a range in order to create a Calc Zone. MATLAB Notebook Error0 B@hH2@l8D ******************************************************************* End of MacroD *******************************************************************hVAttribute VB_Name = "mwInsertRecalcZone" ' *?i C  $a  zw cellByPublic Sub MAIN() Dim savStartEndnAt pos  mar kTota[Re/s__$(07i.temp$found1j234compare_ lagnC)i|nF/ M @-# If WordBasic.GetSel=Pos() <>N>Then U@  '--- check to see if we havelectedvalid raXngeGG#SB7R{F,ȃH OpfLinJLOfDocumentM= 0 GAE<0G'Els AKIf ?EPPoPA! - 1!d @!" At [ # W :Ey*bgBookB{;%1$K3, G >SE, AAFor i!) To G eAB4i) [!$]@(i + 1l Next @e B I`nStr(P, "INPUT" 2AUTPOINIw3wZONEBREAK4OUTYd+ d3/"#(FB >À bCmpW"\^","D!fep8Uq A3 Or 4P PAQ81VqCT O ZB8eep-wMsgBox@-njx ."Ch/<3)}"AQ cannot begin @end a.P"MATLAB NotebM Error048 UGoF~D/! E WaitCurs@ @"now!_ actually nvePi?lc breaks arQ this.0,+Öp-|2While d<=Y A@oR~SSo:7G&>`TR? Д8theal@dy a,1 bdo (hing<0R&_U xWNQ6(&p2=&V0<YF"u s =U&{W@ > -1@x )$Oy S(_d o 6[ zO8 J8–7(V37777N7?7yJre_ = 0 And InStr(1, temp$, "ZONEBREAK") >Then  GoTo PDone 1 ]nFouE= nCt + 1OS+> markTotalX3}.-*` RV-aVWend_[-ns__$(^)*nAt]>=5,O'--- CreatHe z bks CalcZCp= WordBasic.Val(G[GetDocumentVa r$]("")) AN30PzM$ŀUCase("-B3+ "_"=_ H2LTrim0A0 SetSelRange posY,KGOfLiMInser`tParaBli type 3 (continuous section)9 # T:=3UqaUp lhd@itBook[ @Name:=2, Add:=v ϕ$$ I MStartO<`MM G`'[MdgM""N")-?R?R?R'?R?R?R蚿$$$/RWW7_&EhB"\@Of`"8g>h V,H O%5\ELElsCX7Beepc.MsgBox "Invalid* 2 AV.UCh 3);V"You mustPIlpI a r"Rin er to cK0Zga , Z"MATLAB Noteb0 Error", 487s :af!Sub ' *?a"of MacroOa mwMatlabRecalcZone&imwMatlabRepeatEval&PS 4mwMatlabPurgeOutput( mwNotebookHelpAbout(RU xfXT(T(6 << <BC3 $*\Rffff*2233425ded `nn@ @ -@ x@  @ @ lls @ . IfP? @ @ @ @ `@ $MEt J P @p F J"HPX`hpx *  & HX <h*  .8@ .Hx 0  ( 0 @ P` x  &      0 P `p   ( 0 8 H ` p    4 44@ x P8 (8 @P X`    J " JH  D ******************************************************************* MatlabRecalcZone!: Calc all cells in current Calc zone. If you're not in a? zone, Calc the whole notebook. Autocalc cells are also done.pyD *******************************************************************Z@ZXZpZZZZZZZZ0ZH xZ$--- don't Calc if there are no cells %h --- Save the selection positions %' %'6--- if there aren't any zones, calc the whole notebook CalcZoneCount % %' (--- add call to Calc whole notebook heremwMatlabRecalc B@(h(--- find out what zone we're in (if any) % ''      % ZONEBREAK~  '  % + h   '   $ ' \Sel  %'\Sel  $  %'    'hh  \Sel$  %'  B@ %'$  B@D %'   B@a8 $  B@D %' B@ %'   B@hh  $  B@D %'  $  B@D %'   B@h@ .--- Get all the cells in the current selection---- and evaluate the input and autoinit cellsmwGroupCells.GetSelectedCells   B@(     $ INPUT~  $ AUTOINIT~ mwMatlabEval.EvalInputCell $  %(' B@h hamwMatlabRecalc B@(hxp--- Put the selection back   B@l0D ******************************************************************* End of MacroD *******************************************************************`Attribute VB_Name = "mwMatlabRecalcZone" ' *?Y Cm all cells in current z. If you're not#a<,(the whol"ebook. Auto[a?als8o d* mPublic Sub MAIN() Dim sel StartEn*dnsmarkTotalkhi n$$ Cmp12g M/gg?aAAVIfNexc > -1l@#)%0aaAn$`id.n'aKmpes("\ q",D$P~2_4 1` And ! 2!Bn&'a)3em%6_5^%*e20e 3u "!OfEI g_VuWW7_EditE ag}ZP]yS_Rangeb' ( Els(R  1 J(1uw  3PPRQGg'-H Ц2]6хRDwD yc.O_'eAv6tÑ7aPevaluainpP{aainit EGroupC硸ed`]v,ow p!xt { h&(f|(i{INPUTzOr _RDAUTOINI)/c6WZ7a(E.AIA0( }Zx$creenRefresh 76 iq5+NYTI :P$$6' back  WPWPa?q5ofcroO tx| XTVT l) (6 <<<BC3 "*\Rffff*53479b29c0 $$€$ $@ €D D@€T T@ p `<@QQ  @l @\ @L P4H@@8 `v4 @l$ `@H OO^YhI I Ph@X @H `@X0@€ @€8 @€`4 4@€d d@X`808x 0H @ @ ?@ @ @  @ 00 @@ @| @l ?@\ @L ;P< GhHhXPphl ^(8 @( b : @ ( @   @ @ h @x $@h F@X @H :@8 @( " %0HxME  J P >p H J DH   " (08 @ H P X ` h p *xF7.C.C =P4Cp0C.C8C*=@4Cp2C2C  ( H &X to% D  h p1x AO 2 2 @pmH    $206H` h `1  (%  8 H P JX 8 J B 0 8 @ H  P ,X  +  "3  3           +   @ H (P   x  "    +     0 @ %H +`  (   $? 3     3  @ H  P  *&X  (   6 8 . $A( PX 6`   %8: @ PX&Ah+++     J( ,x J""?3(+H `"3h  3  Nr $8(0 J8 " J pD ******************************************************************* MatlabRepeatEval7 Sends selected input cells to MATLAB for evaluation.A Loop through the cells continuously, controlled by dialog box.D *******************************************************************=Declare Function IsAppLoaded Lib "kernel"(name$) As Integer \ Alias "GetModuleHandle"Z0ZX8Z` 8Z@ZXZpZZZZ'''''''$--- dialog definition for RepeatEval@ Evaluate LoopmwMatlabRepeatEval.RepeatEval B@noXS&tartstart B@toX&Pausepause B@!] B@r] Loop Count:Text3 B@f( LoopCountText B@foX&Closeclose B@.] Stop After: stopAtText B@f,D stopAtCount B@ Ka Loop Speed:Text4 B@fHB&FasteridleFast B@HF&SloweridleSlow B@ B@t--- Setup error handler@E --- Check that MATLAB is running MATLAB Command Window %' MATLAB Command Window %mwMatlabStartup B@(h>--- Find all input and autoinit cells in the current selection'' % '       %' 4 % %\sel 4 %'a\para 4 %'h   4INPUT~  4AUTOINIT~     4 +   ''hh --- show Evaluate Loop dialog !x!z.v v !|%z'la--- No cells selected B@;To use Evaluate Loop, first select one or more input cells. Evaluate Loop0 B@hError in MatlabRepeatEval B@ B@lD *******************************************************************2 Callback function for the RepeatEval dialog boxD *******************************************************************ZZZ HQ--- initialize the dialog boxpause B@ LoopCountText0 B stopAtCount10 B ' --- init loop speedK' 'idleFast B@'HQ !--- User chooses the Start button startA@ --- User adjusts loop speed idleSlowb  'idleFast B@ idleFastb    'aidleSlow B@idleFast B@hx !--- User chooses the Pause button pausebpause %&Resumepause&Pause B'apause&Resume B'hh closeF'`F'gHQ "--- User changes the Stop at value  stopAtCount stopAtCount %'   %  %'h stopAtCount $: BhHQ/--- Dialog is idle, Evaluate the selected cells  FA@g    LoopCountText B@   mwMatlabEval.EvalInputCell $  %(' B@X  ' LoopCountText $: Bstart B@pause B@close B@'a  'hh'PkfD *******************************************************************% Handle the Start/Stop button pressD *******************************************************************start %S&topstartS&top Bpause B@' LoopCountText0 B' 'astartS&tart B'' pause %&ResumeFpause&Pause Bghh l` D ******************************************************************* End of MacroD ******************************************************************* WordBasic.DlgEnable "pause", 0HWordBasic.DlgEnable "pause", 0@eAttribute VB_Name = "mwMatlabRepeatEval" ' *? Sends selected input cells to MATLAB for euation.9Loop thrPoughe5continuou sly,  rollZby dialog box !l*EDeclare FuncO IsAppLoad:Lib "kernel"(n$) As Integer \eAlias "GetModuleHandl"eDimMarks__$()  Total, startf@lag, lCountMax( iDelFa@GMinA{Public Sub@^INRe R0 bF@dm'#s.$TestCdlg1BObj~rc 0 678389:C'---EdefiniBo WordBasic.B eginD320, 144, "e "5.J GPushButton 1511, 88, 2"S>&vB16M&PauseARp KG`gpBox`2890, 93@ Tepxt 3@A1Bpb.: 3S13 4&B _!(#2ClocA "&4 &StAf(ter"sAtb#3 #=62:1`"32, 797 2$Speed$45 %76&a&F|as,\17-SloxwerPEndC[AcSet@up errh"r On E"GoTo -1<: +B ChHeck atis runningIf (`HIsR("Comm@ Win dow")!x A0nd _>% )0 TheࠋdCallSqup@'Q& IfF  A#؁autoinurr!C` 㨣 檇$OBooks() - 1 )>= 0\AFia  \[$](i + 1$a` @nHSelbPo <> q13dCmLu"\P . hElse ^para  (InStr(@R@NINPUT +>Or+v?0AUTOINI/d .(0 7@ 3R1<= 8)9-q 2Rw5@{9vygv-)1yN@e `"+'Hshow v{SJ =$CurValues.UserM1rc*$X(##"No<;e+Beep7MsgAd"5x , firstį one 8mo7.(>48_wXHW:Print@7tusBar02\IO  qO__ Ubaafthe 7UpA va V(id$, Aq¼, wp QtmptinonsE(A sesQ"Ca@1 $alizeaW%DlgEna ble ", o15'[$] "pE0koi @1]Qc1l s!K ыbs75U[r $=r5b22 !C cho (k PpK#E p"KPressR adjustsdHS0pZ25ӳ WordBasic.DlgEnable "idleFas t", 1 ElseIf id$ =N ThenRleDelay >jMin/1}2=2 - 25aE FocusSlXow" 0E nd If '--- User chooses the Pause buttop"k[Text$](")&Resu\me!F , "&*Istartflag !d-XIaf<> "clfI RepeatEval5 0SCaq3W|angD|Stop at ue !s AtCountUltmpA~=) M VaTl( )`q0ploopMax`!p?o -a > , Str(  .(lDialogH is, A8uate"nselected cel = " PressS!]_(` AD H$yL 0{qFor i38o inputTotW-0`noErrorsJ:Call("mwMatlabA'.I C@&(b Marks__$(i))pL gScreenhRef (h' ~N/%1c+' J%J P`.%";OcN#E= ΛSIgp&s?Q P/7wS5 Functiqm ' *a Han<8/U#t p!: PrDivqCSub?(O#= w'("##)r eS&\=\o$] dv3wx)}& rOx1"0E7'%j` )_=( (2)/* _ Eώ'O9Q/qq0# ('?abFof MacroO/      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~XTTT (6 << <BC3 $*\Rffff*2033425ded `%% P Pook @ x@ @P $ME* J P 8p J" (8&H 4p     4 Pp  6 P Xhpx J " JPD ******************************************************************* MatlabPurgeOutput2 Purge the current selection of all output cellsD *******************************************************************Z@ZXZpZZ  $' MATLABFmtStyle %$' mwGroupCells.GetSelectedCells   B@(     $ OUTPUT~'P P $  B@D.--- for loose format also purge the blank line--- before the cell loose \StartOfSel B@D B@ B@H %  B@h $  B@Dh B@)"--- delete selection and next charh hlD ******************************************************************* End of MacroD *******************************************************************Attribute VB_Name = "mwMatlabPurgeOutput" ' *s? q the current selection of@ all o `cells4BPublic Sub MAIN() Dim nlF$:FmtmarkTotal ipoG Res__$<(0% %Chpr(13 * LCase(WordBasic.[GetDocumVar$]("@MATLABBS@tyle")! 6 ,CGrPoupC.#Sed", Lg2IfB > 0 ThenAFor i@+o - 1 ÀB@ InSt;(i), "OUTPUT"@ @A G9WW7_EditGoTC!Yi  '--- f-loos"eAmatso pblank line 1beeTO .Gr""LNT2"\StartOfk@I OPar8aUp"A EndOfL@6 h@.ݧ[E@mM)8!V @H xtend&3 If; WW6bEClear 2 "Bdb'and next charM N ~Aefin: _  @Macro  xOXTRTk (6 <<LBC3 "*\Rffff*43479b29c*\R1*#b1 p`|@@ll `v ~`  YI I xpjH$j$X@X@X ppXME' J P (p J" ,1<C(7hT=HC6: H 4X6x  J > J(B  x  6  J "P JxXD *******************************************************************K NotebookHelpAbout-" Displays the Notebook about boxD *******************************************************************Z@~About MATLAB Notebook B@na All Rights ReservedText4 B@ftX B@p"P\ +Copyright (c) 1984-1998 The MathWorks, Inc.Text3 B@fXC B@rA The MATLAB Notebook for WindowsText5 B@f B@tZXE !x!z.v v !|%z'llD *******************************************************************8 Callback function for the Notebook Options dialog boxD *******************************************************************p --- Initialize dialog boxHQ2 DlgSetPicture "Picture1", "AboutNotebook", 1PkfD ******************************************************************* End of MacroD *******************************************************************'W Version 1.5.2Text6 B@fH6 November 24, 1997Text1 B@f8Attribute VB_Name = "mwNotebookHelpAbout" ' *3? Displays t$he# a b ox$BPublic Sub MAIN() D im rcsWordBasic.BeginDialog 382, 144, "aTLABR Text 1 27, 915 13ll Rights Reserved" 4"OKButton 15016, 88, P21 63N8)3416Copyr6 (c) 1984-1998 TMathWks, Inc.!3!GroupBox 2P5, 3AA65"+ =61A)79 <AK for Windows515238R5VersiAE.5.2E6T#5@FoBENovember 2h9971GpEndAdlg As Object: Set = CurValues.Uvyrc H( AʃCallback funct'N_Ops d]mp# Priva Fge(CtlId$(, A",pp#@(!Sel, Case^'---@Vit`izejb dRem Dlg@5Pic@ture "1o>B kBElseD2"244$"4b of Macro > xBXTPT 6 <$mwShowHideCellMarks(JGmwInsertAutoInitCell*TV mwNewNotebookFromCmdLine28 PROJECTX<<< <<<<<(<,<0<4<8<<<BC3 "*\Rffff*33479b29c `@@Ll PNh@PX xJ8 $8J$@(h@3@T @D @4 @$ @ $@ @ XXXX^`bdfh( H X^`bdfhx( @ pME" J P >p J"%  &H0X p )(= Hk  ()@(=X xHk  % J "P Jx(D *******************************************************************  ShowHideCellMarks 8 toggles the show bookmarks parameter and changes menuD *******************************************************************Z@ZXZp %R'LNotebook  %T' N NShow~'P show cell marks P X B@VShowCellMarkers$: B@ZHide &Cell MarkersNotebookMenu Bar$%%(a hide cell marksX B@VShowCellMarkers$: B@ZShow &Cell MarkersNotebookMenu Bar$%%(h L B@&hlD ******************************************************************* End of MacroD ******************************************************************* WordBasic.ToolsCustomizeMenus Category:=2, Name:="mwShowHideCellMarks", Position:=9, Menu:="Notebook", MenuText:="Hide &Cell Markers", Rename:=1, Context:=1 WordBasic.ToolsCustomizeMenus Category:=2, Name:="mwShowHideCellMarks", Position:=9, Menu:="Notebook", MenuText:="Show &Cell Markers", Rename:=1, Context:=1wAttribute VB_Name = "mwShowHideCellMarks" ' *3? toggles the s bookm parter and chang(me nu:BPublic Sub MAIN() Dim oldDirtyFlag temp$pops WordBasic.IsTlat>e"*" [MgI Text$]("Note", 0, 9,< 1I6;InStr(1, %, ""'c :If > 0 ThenG,ToolsOptions@View BEa:=1 SetDocuctVar!ers@/)&' LCustomizeA@s C@Kgory:=2$, :=R, Posi*:=@G@ HMAS@ &% %Ren@5, ContC]8CommBars(" "). rIHh8aOh"PElseC' h jge0 ce~022a>=2u2!V2t222c(EIf)e {f-*} 2% Subߕ !g of[cro x.XT^TJn (6 << <BC3 $*\Rffff*1d33425ded `P.@0 hP2xP4,ert $ ME$ J P Hp J"(08@H $Px> > (,8:h      0@H P JX " J (D ******************************************************************* InsertAutoCalcCellA Insert a new autocalc cell, or redefine an existing input cell to be an autocalc cellD *******************************************************************Z@ZXZpZ--- Create a new autocalc cellAutoInit' .(mwInsertInputCell.InputCellFromSelection . %('08--- if an existing input cell is selected, convert it to--- an autocalc cell 0  .$6_ 0$: %8 ' 2 Input$6_ 0$: %8 ' 4 4 %< 4 2 B@> 4B B@@ 2 B@D . B@F \endofsel B@D B@HhhlD ******************************************************************* End of MacroD *******************************************************************]Attribute VB_Name = "mwInsertAutoInitCell" ' &*? Ca lca  a nPew ac c, or redefine an existing input#Cto b! ?BPublic Sub MAIN() Dim type_$!curriNumfMark X '---` CreaÐ| /υˀ 6WordBasHic.l(I I.FromSelectioxn",D03B%ifZ is sed, conv@ it toi aA,If (I-> 0) ThenCL@4UCase(?) + "_"@9[LTrim$](Str)@2G\"A"G_G k6 EBookm(! <pCopy ÷,'Hdit:=, D@lte:=1: WW7_E`GoTo FormatStyle c 4 "\endof`HXndO fL} End Ife !q"! of Macr[ *x$XT\T@ (6 L<BC3 "*\Rffff*23479b29c*\R1*#c1*\R1*#17b `hk p$$pP"h @x "P@h 0x@ME J P @p H J"H)P%p%%  J & J8D ******************************************************************* NewNotebookFromCmdLine9 Macro to create a new doc based on the m-book templateB This macro launched from the command line of the Notebook icon.D ******************************************************************* m-book.dot" B@  M-BOOK.DOT B@$ B@& B@( B@*l@D ******************************************************************* End of macroD *******************************************************************pLAttribute VB_Name = "mwNewNotebookFromCmdLine" ` ' *?  Macro to creaa new doc based on the m- templ&;This m@launch /f1comm and l of u icon."qPublic Sub MAIN() WordBasic.File_:="h.dotActiv"M-BOOK.DOTSetTDirty 0 :Docume nt%Close E@J/?~Th5Abl_ ID="{5A3D3A7C-AB5C-11D0-B6F5-00A0249C4B47}" Document=ThisDocument/&H00000000 Module=mwNewNotebookFromCmdLine Module=mwInsertAutoInitCell Module=mwShowHideCellMarks Module=mwNotebookHelpAbout Module=mwMatlabPurgeOutput Module=mwMatlabRepeatEval Module=mwMatlabRecalcZone Module=mwInsertRecalcZone Module=mwNotebookOptions Module=mwInsertInputCell Module=mwUndefineCells Module=mwMatlabToFront Module=mwMatlabStartup Module=mwUngroupCells Module=mwMatlabRecalc Module=mwToggleGraph Module=mwNewNotebook Module=mwMatlabHelp Module=mwMatlabEval Module=mwGroupCells Module=AutoClose Module=AutoOpen Module=AutoExit Module=AutoNew Name="TemplateProject" HelpContextID="0" CMG="969449E549EDDBF1DBF1DBF1DBF1" DPB="2C2EF39B1F3020302030" GC="C2C01D09B20AB20A4D" [Host Extender Info] &H00000001={3832D640-CF90-11CF-8E43-00A0C911005A};VBE;&H00000000 [Workspace] ThisDocument=0, 0, 0, 0, C mwNewNotebookFromCmdLine=0, 0, 0, 0, C mwInsertAutoInitCell=242, 242, 955, 904, C mwShowHideCellMarks=352, 352, 1043, 1120, C mwNotebookHelpAbout=132, 132, 1000, 584, C mwMatlabPurgeOutput=264, 264, 977, 926, C mwMatlabRepeatEval=198, 198, 1170, 966, C mwMatlabRecalcZone=176, 176, 1148, 944, C mwInsertRecalcZone=286, 286, 999, 948, C mwNotebookOptions=-347, 69, 867, 864, mwInsertInputCell=74, 166, 672, 934, C mwUndefineCells=0, 0, 0, 0, C mwMatlabToFront=22, 22, 667, 687, Z mwMatlabStartup=138, 67, 886, 742, C mwUngroupCells=198, 198, 911, 860, C mwMatlabRecalc=154, 154, 1126, 922, C mwToggleGraph=0, 0, 0, 0, C mwNewNotebook=0, 0, 0, 0, C mwMatlabHelp=176, 176, 902, 851, C mwMatlabEval=-218, 177, 740, 931, C mwGroupCells=154, 154, 774, 922, C AutoClose=22, 22, 958, 685, C AutoOpen=0, 0, 0, 0, C AutoExit=220, 220, 933, 882, C AutoNew=0, 0, 0, 0, C ThisDocumentThisDocumentmwNewNotebookFromCmdLinemwNewNotebookFromCmdLinemwInsertAutoInitCellmwInsertAutoInitCellmwShowHideCellMarksmwShowHideCellMarksmwNotebookHelpAboutmwNotebookHelpAboutmwMatlabPurgeOutputmwMatlabPurgeOutputmwMatlabRepeatEvalmwMaPROJECTwmCompObjZ jObjectPool``    tlabRepeatEvalmwMatlabRecalcZonemwMatlabRecalcZonemwInsertRecalcZonemwInsertRecalcZonemwNotebookOptionsmwNotebookOptionsmwInsertInputCellmwInsertInputCellmwUndefineCellsmwUndefineCellsmwMatlabToFrontmwMatlabToFrontmwMatlabStartupmwMatlabStartupmwUngroupCellsmwUngroupCellsmwMatlabRecalcmwMatlabRecalcmwToggleGraphmwToggleGraphmwNewNotebookmwNewNotebookmwMatlabHelpmwMatlabHelpmwMatlabEvalmwMatlabEvalmwGroupCellsmwGroupCellsAutoCloseAutoCloseAutoOpenAutoOpenAutoExitAutoExitAutoNewAutoNew  FMicrosoft Word Document MSWordDocWord.Document.89q?S?S????????S??S?????????S?S?m???? dg?g?????0 @?~C?~C??g?g?S?S?S?S? / =!"#$%G:Times New Roman5Symbol3& :ArialG5  hMS Mincho-3 fg?5 :Courier New"h0