InMATLAB®,arrayshavepassbyvalue
semantics,withalazycopyonwritescheme
topreventactuallycreatingcopiesuntilthey
areactuallyneeded.Sliceoperationscopy
partsofthearray.
Sliceoperationsareviewsintoanarray.
InMATLAB®,everyfunctionmustbeina
fileofthesamename,andyoucan'tdefine
localfunctionsinanordinaryscriptfileorat
thecommandprompt(inlinesarenotreal
functionsbutmacros,likeinC).
NumPycodeisPythoncode,soithasnosuch
restrictions.Youcandefinefunctionswhereveryou
like.
MATLAB®hasanactivecommunityand
thereislotsofcodeavailableforfree.But
thevitalityofthecommunityislimitedby
MATLAB®'scost;yourMATLAB®
programscanberunbyonlyafew.
NumPy/SciPyalsohasanactivecommunity,based
righthereonthiswebsite!Itissmaller,butitis
growingveryquickly.Incontrast,Pythonprograms
canberedistributedandusedfreely.SeeTopical
Softwareforalistingoffreeaddonapplication
software,MailingListsfordiscussions,andtherestof
thiswebsiteforadditionalcommunitycontributions.
Weencourageyourparticipation!
MATLAB®hasanextensivesetofoptional,
domainspecificaddons('toolboxes')
availableforpurchase,suchasforsignal
processing,optimization,controlsystems,
andthewholeSimuLink®systemfor
graphicallycreatingdynamicalsystem
models.
There'snodirectequivalentofthisinthefreesoftware
worldcurrently,intermsofrangeanddepthoftheadd
ons.HoweverthelistinTopicalSoftwarecertainly
showsagrowingtrendinthatdirection.
MATLAB®hasasophisticated2dand3d
plottingsystem,withuserinterfacewidgets.
AddonsoftwarecanbeusedwithNumpytomake
comparableplotstoMATLAB®.Matplotlibisa
mature2dplottinglibrarythatemulatesthe
MATLAB®interface.PyQwtallowsmorerobustand
fasteruserinterfacesthanMATLAB®.Andmlab,a
"matlablike"APIbasedonMayavi2,for3Dplotting
ofNumpyarrays.SeetheTopicalSoftwarepagefor
moreoptions,links,anddetails.Thereis,however,no
definitive,allinone,easytouse,builtinplotting
solutionfor2dand3d.Thisisanareawhere
Numpy/Scipycouldusesomework.
MATLAB®providesafulldevelopment
environmentwithcommandinteraction
window,integratededitor,anddebugger.
NumpydoesnothaveonestandardIDE.However,the
IPythonenvironmentprovidesasophisticated
commandpromptwithfullcompletion,help,and
debuggingsupport,andinterfaceswiththeMatplotlib
libraryforplottingandtheEmacs/XEmacseditors.
MATLAB®itselfcoststhousandsofdollars
ifyou'renotastudent.Thesourcecodetothe
mainpackageisnotavailabletoordinary
users.Youcanneitherisolatenorfixbugs
andperformanceissuesyourself,norcanyou
directlyinfluencethedirectionoffuture
development.(Ifyouarereallyseton
Matlablikesyntax,however,thereisOctave,
anothernumericalcomputingenvironment
thatallowstheuseofmostMatlabsyntax
withoutmodification.)
NumPyandSciPyarefree(bothbeerandspeech),
whoeveryouare.
评论0
最新资源