├── .gitattributes ├── .gitignore ├── 18subplots_onbe.fig ├── AnalyzingNeuralTimeSeriesData ├── Cohen_AnalyzingNeuralTimeSeriesData_TOC.pdf └── code │ ├── accumbens_eeg.mat │ ├── amsterdam.bmp │ ├── armorf.m │ ├── chapter02.m │ ├── chapter04_datafile.txt │ ├── chapter04_excel_data.xls │ ├── chapter04_headache_data.txt │ ├── chapter04a.m │ ├── chapter04b.m │ ├── chapter04c.m │ ├── chapter05.m │ ├── chapter06.m │ ├── chapter09.m │ ├── chapter10.m │ ├── chapter11.m │ ├── chapter12.m │ ├── chapter13.m │ ├── chapter14.m │ ├── chapter15.m │ ├── chapter16.m │ ├── chapter17.m │ ├── chapter18.m │ ├── chapter19.m │ ├── chapter20.m │ ├── chapter22.m │ ├── chapter23.m │ ├── chapter25.m │ ├── chapter26.m │ ├── chapter27.m │ ├── chapter28.m │ ├── chapter29.m │ ├── chapter30.m │ ├── chapter31.m │ ├── chapter33.m │ ├── chapter34.m │ ├── cover_art.m │ ├── data2psiX.m │ ├── data_output_SPSS_format.txt │ ├── data_written_from_matlab.txt │ ├── emdx.m │ ├── entropyx.m │ ├── erpviewerx.fig │ ├── erpviewerx.m │ ├── fdr.m │ ├── figure34_3_data.mat │ ├── frequency_sliding_and_median_filter.m │ ├── interpolate_nola.m │ ├── interpolate_perrinX.m │ ├── laplacian_nola.m │ ├── laplacian_perrinX.m │ ├── mutualinformationx.m │ ├── my_matlab_variables.mat │ ├── pathlength.m │ ├── sampleEEGdata.mat │ ├── solutions2exercises.pdf │ ├── tfviewerx.fig │ └── tfviewerx.m ├── BenchmarkingSpikeSortingPrograms.m ├── CellArrayOfStruct2Table.m ├── ElecCoord.m ├── ExtractChunks.m ├── FR_Histo.m ├── FigViewer ├── FigViewer.exe ├── FigViewer.m ├── FigViewer.prj ├── FigViewer │ ├── PackagingLog.html │ ├── for_redistribution │ │ └── MyAppInstaller_web.exe │ ├── for_redistribution_files_only │ │ ├── FigViewer.exe │ │ ├── readme.txt │ │ └── splash.png │ └── for_testing │ │ ├── FigViewer.exe │ │ ├── mccExcludedFiles.log │ │ ├── readme.txt │ │ ├── requiredMCRProducts.txt │ │ └── splash.png ├── mccExcludedFiles.log ├── readme.txt └── requiredMCRProducts.txt ├── Gdatatheor ├── README ├── buttfilt.m ├── countprob.m ├── dispersion.m ├── fithifref.m ├── fithlifref.m ├── gaussroc.m ├── gfitheor.m ├── gpstheor.m ├── isidist.m ├── lgnfilt.m ├── neymtacnt.m ├── poisscnt.m ├── prefdisp.m ├── psautospk.m ├── psautostim.m ├── roc.m ├── sndpdisp.m ├── stesttheor.m ├── stimest.m └── wiener1.m ├── GenNoisySig.m ├── ImportJRClusSortInfo.m ├── InhCumWeib.m ├── JaccardTest.m ├── MahalClusDist.m ├── MakeASCII4.m ├── Matlab2Goog ├── Matlab2GoogTest.m ├── README.txt ├── changeWorksheetNameAndSize.m ├── connectNAuthorize.m ├── createSpreadsheet.m ├── createWorksheet.m ├── deleteSpreadsheet.m ├── deleteWorksheet.m ├── editWorksheetCell.m ├── getSpreadsheetList.m ├── getSpreadsheetListGDocs.m ├── getWorksheetCell.m ├── getWorksheetList.m ├── license.txt └── urlreadwrite.m ├── PopClusteringAuto_Manual.m ├── Raster_sdf_colorevents.m ├── Read_ArduSerial.m ├── Read_ArduSerial_old.m ├── ResamplingStats ├── SchieberLabResamplingStats │ ├── eg18_014.txt │ ├── h14.m │ ├── h15.m │ ├── randomize_matrix.m │ ├── randperm2.m │ └── randsample.m ├── correlation.m ├── nonansem.m ├── nonanstd.m ├── resampling_statistical_toolkit │ ├── __MACOSX │ │ └── statistics │ │ │ ├── ._README.txt │ │ │ └── ._statcond.m │ ├── license.txt │ └── statistics │ │ ├── .svn │ │ ├── all-wcprops │ │ ├── entries │ │ └── text-base │ │ │ ├── README.txt.svn-base │ │ │ ├── anova1_cell.m.svn-base │ │ │ ├── anova1rm_cell.m.svn-base │ │ │ ├── anova2_cell.m.svn-base │ │ │ ├── anova2rm_cell.m.svn-base │ │ │ ├── concatdata.m.svn-base │ │ │ ├── corrcoef_cell.m.svn-base │ │ │ ├── fdr.m.svn-base │ │ │ ├── statcond.m.svn-base │ │ │ ├── teststat.m.svn-base │ │ │ ├── ttest2_cell.m.svn-base │ │ │ └── ttest_cell.m.svn-base │ │ ├── README.txt │ │ ├── anova1_cell.m │ │ ├── anova1rm_cell.m │ │ ├── anova2_cell.m │ │ ├── anova2rm_cell.m │ │ ├── concatdata.m │ │ ├── corrcoef_cell.m │ │ ├── fdr.m │ │ ├── stat_surrogate_ci.m │ │ ├── stat_surrogate_pvals.m │ │ ├── statcond.m │ │ ├── statcondfieldtrip.m │ │ ├── surrogdistrib.m │ │ ├── teststat.m │ │ ├── ttest2_cell.m │ │ └── ttest_cell.m └── shuffle.m ├── SEM_calc.m ├── SFC.m ├── SHdaq2csv.m ├── SHdaq2mat.m ├── SelectElipse.m ├── ShuffledClassification.m ├── Spk2txt.m ├── UserDirInfo.m ├── adinstruments_sdk_matlab ├── +adi │ ├── +examples │ │ ├── conversion_speed_testing.m │ │ ├── e001_writeFileFromScratch.m │ │ └── e002_addCommentsToAnExistingFile.m │ ├── +postp │ │ └── mergeComments.m │ ├── +sdk │ │ └── ReadMe.md │ ├── +sl │ │ ├── +array │ │ │ └── uniqueWithGroupIndices.m │ │ ├── +cellstr │ │ │ └── join.m │ │ ├── +datetime │ │ │ ├── getTimeZone.m │ │ │ └── unixToMatlab.m │ │ ├── +dir │ │ │ ├── changeFileExtension.m │ │ │ └── filepartsx.m │ │ ├── +in │ │ │ ├── processVarargin.m │ │ │ └── process_varargin_result.m │ │ ├── +stack │ │ │ ├── calling_function_info.m │ │ │ ├── getMyBasePath.m │ │ │ └── getPackageRoot.m │ │ └── +str │ │ │ └── contains.m │ ├── +tests │ │ └── t001_speedWritingAndWriting.m │ ├── @channel │ │ ├── channel.m │ │ └── exportToHDF5File.m │ ├── @file_viewer │ │ ├── file_viewer.m │ │ └── private │ │ │ └── main.fig │ ├── binary_channel_writer.m │ ├── binary_file_writer.m │ ├── channel_writer.m │ ├── comment.m │ ├── comment_handle.m │ ├── convert.m │ ├── createFile.m │ ├── data_writer_handle.m │ ├── documentation │ │ ├── FunctionMapping.csv │ │ └── com_interface_notes.m │ ├── editFile.m │ ├── extractRecordToNewFile.m │ ├── file.m │ ├── file_handle.m │ ├── file_read_options.m │ ├── file_writer.m │ ├── h5_conversion_options.m │ ├── h5_file_h.m │ ├── h5_file_sdk.m │ ├── handle_logger.m │ ├── handle_manager.m │ ├── mat_comment_handle.m │ ├── mat_conversion_options.m │ ├── mat_file_h.m │ ├── mat_file_sdk.m │ ├── private │ │ ├── ADIDatCAPI_mex.h │ │ ├── c.m │ │ ├── c0.m │ │ ├── clong.m │ │ ├── sdk_mex.cpp │ │ ├── sdk_mex.mexw32 │ │ └── sdk_mex.mexw64 │ ├── readFile.m │ ├── record.m │ ├── sdk.m │ └── test_SDK.m ├── .gitignore ├── LICENSE ├── README.rst ├── adi.m ├── documentation │ ├── ReadMe.md │ └── organization.md └── files │ ├── LabChartBinaryFormat.pdf │ ├── blank_labchart_8_file.adicht │ └── crash_testing.m ├── adtest2.m ├── aes ├── AES_GET_COUNTER.m ├── Contents.m ├── Readme.m ├── aes.m ├── aesdecrypt.m ├── aesencrypt.m ├── aesinfo.m ├── aesinit.m └── aestest.m ├── alpha_filtconv.m ├── anova_rm.m ├── applyhatch_plusC.m ├── batch ├── ConvertTIFFtoAVI.bat ├── convert_tiff_to_avi.py └── readme.md ├── catamaran_spike_sorting ├── catamaran.m ├── catamaran_doc.pdf ├── nttfile.m └── readme.txt ├── catstruct.m ├── clustering ├── calcAUROC.m ├── clus_pop_ROC.m ├── clusterROC.m └── simpleROC.m ├── compare_clustering.m ├── compare_db_filelist.m ├── compare_db_filelists.m ├── convolve2.m ├── crosscorel.m ├── demo_fiola_pipeline_new.ipynb ├── demo_pipeline_voltage_imaging.ipynb ├── density_estimation-master ├── .gitignore ├── README.md ├── matlab │ ├── sshist.m │ ├── sskernel.m │ ├── ssvkernel.m │ └── tutorial.m ├── python │ └── sskernel.py └── ref │ ├── shimazaki_jcns10.pdf │ └── shimazaki_neco07.pdf ├── disprecdepth.m ├── doseResponse.m ├── dyncirc.m ├── eighteensubplots_onbe.m ├── eventraststats.m ├── exindex.m ├── fconvert.m ├── findauc.m ├── fread_workingresize.m ├── gapstopdebug.m ├── gauss_filtconv.m ├── gaussfilt.m ├── gen_nonhomoPoissonProc.m ├── getdir_fpos.m ├── graphic_interface_toolkit ├── __MACOSX │ └── guifunc │ │ ├── ._README.txt │ │ └── ._inputgui.m ├── guifunc │ ├── .svn │ │ ├── all-wcprops │ │ ├── entries │ │ └── text-base │ │ │ ├── errordlg2.m.svn-base │ │ │ ├── finputcheck.m.svn-base │ │ │ ├── inputdlg2.m.svn-base │ │ │ ├── inputgui.m.svn-base │ │ │ ├── listdlg2.m.svn-base │ │ │ ├── pophelp.m.svn-base │ │ │ ├── questdlg2.m.svn-base │ │ │ ├── supergui.m.svn-base │ │ │ └── warndlg2.m.svn-base │ ├── README.txt │ ├── errordlg2.m │ ├── finputcheck.m │ ├── inputdlg2.m │ ├── inputgui.m │ ├── listdlg2.m │ ├── pophelp.m │ ├── questdlg2.m │ ├── supergui.m │ └── warndlg2.m └── license.txt ├── h5create_Ephys.m ├── instantfr.m ├── latency_analysis.m ├── linspecer ├── license.txt └── linspecer.m ├── listresortfiles.m ├── m2vbColor.m ├── make_movie_from_signal.m ├── mcnemar.m ├── min_max_values.m ├── my_cc_circ_shift.m ├── mysql ├── mysql.cpp └── mysql.m ├── nanconv.m ├── nonhomopp.m ├── nonparam_ttest_comp.m ├── open_dicom.m ├── openreadclose.m ├── periodCmdplot.m ├── plot2svg ├── README.md ├── example │ ├── demo_3d_plot2svg.m │ ├── demo_svg_water.m │ ├── gradient.png │ ├── matterhorn_small.jpg │ ├── output │ │ ├── demo_svg_water.jpg │ │ ├── demo_svg_water.svg │ │ ├── sphere.png │ │ ├── sphere.svg │ │ ├── sphere.svgz │ │ ├── temperature_nicer.svg │ │ ├── temperature_perfect.jpg │ │ ├── temperature_perfect.svg │ │ ├── temperature_standard.svg │ │ ├── tutorial_filters.jpg │ │ └── tutorial_filters.svg │ ├── tutorial_filters.m │ ├── tutorial_plot2svg.m │ └── water_stones.jpg ├── license.txt └── src │ ├── plot2svg.m │ ├── simulink2svg.m │ ├── svgBoundingBox.m │ ├── svgComposite.m │ ├── svgGaussianBlur.m │ ├── svgImage.m │ ├── svgLuminanceToAlpha.m │ ├── svgOffset.m │ ├── svgSpecularLightingDistant.m │ └── svgTurbulence.m ├── plot_JRClust_waveform_export.m ├── ploteyesac.m ├── poissonTutorial.m ├── rasterstattest.m ├── rastplotstat.m ├── raststats.m ├── read_and_make_movie.m ├── read_videoframes.m ├── readxlsrownum.m ├── rec_plot.m ├── regexpisymbols.m ├── shifter.m ├── siglag.m ├── sigmoidfit.m ├── sshfrommatlab_13b ├── ganymed-ssh2-build250 │ ├── HISTORY.txt │ ├── LICENSE.txt │ ├── README.txt │ ├── examples │ │ ├── Basic.java │ │ ├── BasicWithHTTPProxy.java │ │ ├── PortForwarding.java │ │ ├── PublicKeyAuthentication.java │ │ ├── SimpleVerifier.java │ │ ├── SingleThreadStdoutStderr.java │ │ ├── StdoutAndStderr.java │ │ ├── SwingShell.java │ │ └── UsingKnownHosts.java │ ├── faq │ │ └── FAQ.html │ ├── ganymed-ssh2-build250.jar │ ├── javadoc │ │ ├── allclasses-frame.html │ │ ├── allclasses-noframe.html │ │ ├── ch │ │ │ └── ethz │ │ │ │ └── ssh2 │ │ │ │ ├── ChannelCondition.html │ │ │ │ ├── Connection.html │ │ │ │ ├── ConnectionInfo.html │ │ │ │ ├── ConnectionMonitor.html │ │ │ │ ├── DHGexParameters.html │ │ │ │ ├── HTTPProxyData.html │ │ │ │ ├── HTTPProxyException.html │ │ │ │ ├── InteractiveCallback.html │ │ │ │ ├── KnownHosts.html │ │ │ │ ├── LocalPortForwarder.html │ │ │ │ ├── LocalStreamForwarder.html │ │ │ │ ├── ProxyData.html │ │ │ │ ├── SCPClient.html │ │ │ │ ├── SFTPException.html │ │ │ │ ├── SFTPv3Client.html │ │ │ │ ├── SFTPv3DirectoryEntry.html │ │ │ │ ├── SFTPv3FileAttributes.html │ │ │ │ ├── SFTPv3FileHandle.html │ │ │ │ ├── ServerHostKeyVerifier.html │ │ │ │ ├── Session.html │ │ │ │ ├── StreamGobbler.html │ │ │ │ ├── class-use │ │ │ │ ├── ChannelCondition.html │ │ │ │ ├── Connection.html │ │ │ │ ├── ConnectionInfo.html │ │ │ │ ├── ConnectionMonitor.html │ │ │ │ ├── DHGexParameters.html │ │ │ │ ├── HTTPProxyData.html │ │ │ │ ├── HTTPProxyException.html │ │ │ │ ├── InteractiveCallback.html │ │ │ │ ├── KnownHosts.html │ │ │ │ ├── LocalPortForwarder.html │ │ │ │ ├── LocalStreamForwarder.html │ │ │ │ ├── ProxyData.html │ │ │ │ ├── SCPClient.html │ │ │ │ ├── SFTPException.html │ │ │ │ ├── SFTPv3Client.html │ │ │ │ ├── SFTPv3DirectoryEntry.html │ │ │ │ ├── SFTPv3FileAttributes.html │ │ │ │ ├── SFTPv3FileHandle.html │ │ │ │ ├── ServerHostKeyVerifier.html │ │ │ │ ├── Session.html │ │ │ │ └── StreamGobbler.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ ├── constant-values.html │ │ ├── deprecated-list.html │ │ ├── help-doc.html │ │ ├── index-all.html │ │ ├── index.html │ │ ├── overview-summary.html │ │ ├── overview-tree.html │ │ ├── package-list │ │ ├── resources │ │ │ └── inherit.gif │ │ ├── serialized-form.html │ │ └── stylesheet.css │ └── src │ │ └── ch │ │ └── ethz │ │ └── ssh2 │ │ ├── ChannelCondition.java │ │ ├── Connection.java │ │ ├── ConnectionInfo.java │ │ ├── ConnectionMonitor.java │ │ ├── DHGexParameters.java │ │ ├── HTTPProxyData.java │ │ ├── HTTPProxyException.java │ │ ├── InteractiveCallback.java │ │ ├── KnownHosts.java │ │ ├── LocalPortForwarder.java │ │ ├── LocalStreamForwarder.java │ │ ├── ProxyData.java │ │ ├── SCPClient.java │ │ ├── SFTPException.java │ │ ├── SFTPv3Client.java │ │ ├── SFTPv3DirectoryEntry.java │ │ ├── SFTPv3FileAttributes.java │ │ ├── SFTPv3FileHandle.java │ │ ├── ServerHostKeyVerifier.java │ │ ├── Session.java │ │ ├── StreamGobbler.java │ │ ├── auth │ │ └── AuthenticationManager.java │ │ ├── channel │ │ ├── Channel.java │ │ ├── ChannelInputStream.java │ │ ├── ChannelManager.java │ │ ├── ChannelOutputStream.java │ │ ├── IChannelWorkerThread.java │ │ ├── LocalAcceptThread.java │ │ ├── RemoteAcceptThread.java │ │ ├── RemoteForwardingData.java │ │ ├── RemoteX11AcceptThread.java │ │ ├── StreamForwarder.java │ │ └── X11ServerData.java │ │ ├── crypto │ │ ├── Base64.java │ │ ├── CryptoWishList.java │ │ ├── KeyMaterial.java │ │ ├── PEMDecoder.java │ │ ├── PEMStructure.java │ │ ├── SimpleDERReader.java │ │ ├── cipher │ │ │ ├── AES.java │ │ │ ├── BlockCipher.java │ │ │ ├── BlockCipherFactory.java │ │ │ ├── BlowFish.java │ │ │ ├── CBCMode.java │ │ │ ├── CTRMode.java │ │ │ ├── CipherInputStream.java │ │ │ ├── CipherOutputStream.java │ │ │ ├── DES.java │ │ │ ├── DESede.java │ │ │ └── NullCipher.java │ │ ├── dh │ │ │ ├── DhExchange.java │ │ │ └── DhGroupExchange.java │ │ └── digest │ │ │ ├── Digest.java │ │ │ ├── HMAC.java │ │ │ ├── HashForSSH2Types.java │ │ │ ├── MAC.java │ │ │ ├── MD5.java │ │ │ └── SHA1.java │ │ ├── log │ │ └── Logger.java │ │ ├── packets │ │ ├── PacketChannelOpenConfirmation.java │ │ ├── PacketChannelOpenFailure.java │ │ ├── PacketChannelWindowAdjust.java │ │ ├── PacketDisconnect.java │ │ ├── PacketGlobalCancelForwardRequest.java │ │ ├── PacketGlobalForwardRequest.java │ │ ├── PacketIgnore.java │ │ ├── PacketKexDHInit.java │ │ ├── PacketKexDHReply.java │ │ ├── PacketKexDhGexGroup.java │ │ ├── PacketKexDhGexInit.java │ │ ├── PacketKexDhGexReply.java │ │ ├── PacketKexDhGexRequest.java │ │ ├── PacketKexDhGexRequestOld.java │ │ ├── PacketKexInit.java │ │ ├── PacketNewKeys.java │ │ ├── PacketOpenDirectTCPIPChannel.java │ │ ├── PacketOpenSessionChannel.java │ │ ├── PacketServiceAccept.java │ │ ├── PacketServiceRequest.java │ │ ├── PacketSessionExecCommand.java │ │ ├── PacketSessionPtyRequest.java │ │ ├── PacketSessionStartShell.java │ │ ├── PacketSessionSubsystemRequest.java │ │ ├── PacketSessionX11Request.java │ │ ├── PacketUserauthBanner.java │ │ ├── PacketUserauthFailure.java │ │ ├── PacketUserauthInfoRequest.java │ │ ├── PacketUserauthInfoResponse.java │ │ ├── PacketUserauthRequestInteractive.java │ │ ├── PacketUserauthRequestNone.java │ │ ├── PacketUserauthRequestPassword.java │ │ ├── PacketUserauthRequestPublicKey.java │ │ ├── Packets.java │ │ ├── TypesReader.java │ │ └── TypesWriter.java │ │ ├── sftp │ │ ├── AttrTextHints.java │ │ ├── AttribBits.java │ │ ├── AttribFlags.java │ │ ├── AttribPermissions.java │ │ ├── AttribTypes.java │ │ ├── ErrorCodes.java │ │ ├── OpenFlags.java │ │ └── Packet.java │ │ ├── signature │ │ ├── DSAPrivateKey.java │ │ ├── DSAPublicKey.java │ │ ├── DSASHA1Verify.java │ │ ├── DSASignature.java │ │ ├── RSAPrivateKey.java │ │ ├── RSAPublicKey.java │ │ ├── RSASHA1Verify.java │ │ └── RSASignature.java │ │ ├── transport │ │ ├── ClientServerHello.java │ │ ├── KexManager.java │ │ ├── KexParameters.java │ │ ├── KexState.java │ │ ├── MessageHandler.java │ │ ├── NegotiateException.java │ │ ├── NegotiatedParameters.java │ │ ├── TransportConnection.java │ │ └── TransportManager.java │ │ └── util │ │ ├── StringEncoder.java │ │ ├── TimeoutService.java │ │ └── Tokenizer.java ├── license.txt ├── scptomatlab.m ├── sftpfrommatlab.m ├── sshfrommatlab.m ├── sshfrommatlab_publickey.m ├── sshfrommatlab_publickey_file.m ├── sshfrommatlabclose.m ├── sshfrommatlabinstall.m ├── sshfrommatlabissue.m └── sshfrommatlabissue_dontwait.m ├── storeDataFromSerial.m ├── tachCM2.m ├── template_curve_match.m └── tuckermcclure-matlab-plot-big-00aea55 ├── .gitignore ├── LICENSE ├── LinePlotExplorer.m ├── LinePlotReducer.m ├── README.md ├── examples_of_line_plot_reducer.m ├── get_axes_width.m ├── reduce_plot.m ├── reduce_to_width.m └── screenshot.png /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /18subplots_onbe.fig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/18subplots_onbe.fig -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/Cohen_AnalyzingNeuralTimeSeriesData_TOC.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/AnalyzingNeuralTimeSeriesData/Cohen_AnalyzingNeuralTimeSeriesData_TOC.pdf -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/code/accumbens_eeg.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/AnalyzingNeuralTimeSeriesData/code/accumbens_eeg.mat -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/code/amsterdam.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/AnalyzingNeuralTimeSeriesData/code/amsterdam.bmp -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/code/chapter04_datafile.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 2 | 4 5 6 3 | 7 8 9 4 | -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/code/chapter04_excel_data.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/AnalyzingNeuralTimeSeriesData/code/chapter04_excel_data.xls -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/code/chapter04_headache_data.txt: -------------------------------------------------------------------------------- 1 | this is a text file with mixed strings and numbers. 2 | each row contains different information, some useful and some useless. 3 | we'll use matlab to read in each line separately, figure 4 | out whether to keep or trash that line, and extract the data we want. 5 | 6 | in this file, label-value data pairs are separated by tabs. it's the one 7 | useful thing we have to go on here. 8 | 9 | 10 | behavioral data begin on the following line 11 | trial 1 choice 2 rt 450 accuracy 1 12 | choice 2 trial 2 accuracy 0 rt 830 13 | well, i could go on and on, but by this time you'll get the idea -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/code/chapter06.m: -------------------------------------------------------------------------------- 1 | %% Analyzing Neural Time Series Data 2 | % Matlab code for Chapter 6 3 | % Mike X Cohen 4 | % 5 | % This code accompanies the book, titled "Analyzing Neural Time Series Data" 6 | % (MIT Press). Using the code without following the book may lead to confusion, 7 | % incorrect data analyses, and misinterpretations of results. 8 | % Mike X Cohen assumes no responsibility for inappropriate or incorrect use of this code. 9 | 10 | %% Figure 6.2 11 | 12 | % create sine wave 13 | srate = 1000; 14 | time = 0:1/srate:1; 15 | frequency = 3; 16 | 17 | sinewave = sin(2*pi*frequency.*time); 18 | 19 | figure 20 | subplot(311) 21 | plot(time,sinewave,'r') 22 | set(gca,'xlim',[-.05 time(end)*1.05],'ylim',[-1.1 1.1]) 23 | hold on 24 | sampling1 = round(linspace(1,length(time),frequency*2)); 25 | plot(time(sampling1),sinewave(sampling1),'o') 26 | title('continuous sine wave') 27 | 28 | sampling2 = round(linspace(1,length(time),frequency*20)); 29 | plot(time(sampling2),sinewave(sampling2),'+') 30 | 31 | 32 | subplot(312) 33 | plot(time(sampling1),sinewave(sampling1),'-o') 34 | set(gca,'xlim',[-.05 time(end)*1.05],'ylim',[-1.1 1.1]) 35 | title('sampled at 2*frequency') 36 | 37 | subplot(313) 38 | plot(time(sampling2),sinewave(sampling2),'-+') 39 | title('sampled at 20*frequency') 40 | set(gca,'xlim',[-.05 time(end)*1.05],'ylim',[-1.1 1.1]) 41 | 42 | %% end. 43 | -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/code/data_output_SPSS_format.txt: -------------------------------------------------------------------------------- 1 | Name trial choice rt accuracy 2 | billy 1 2 450 1 3 | bob 2 2 830 0 4 | -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/code/data_written_from_matlab.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 2 | 4 5 6 3 | 7 8 9 4 | -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/code/entropyx.m: -------------------------------------------------------------------------------- 1 | function [entropy fd_bins] = entropyx(x,fd_bins) 2 | % ENTROPYX Compute entropy 3 | % 4 | % Inputs: 5 | % x : data matrix 6 | % 7 | % Optional inputs: 8 | % bins : number of bins to use for distribution discretization 9 | % 10 | % Outputs: 11 | % entropy : entropy of x, y, and joint 12 | % nbins : number of bins used for discretization 13 | % (based on Freedman-Diaconis rule) 14 | % 15 | % Mike X Cohen (mikexcohen@gmail.com) 16 | 17 | %% determine the optimal number of bins for each variable 18 | 19 | % vectorize in the case of matrices 20 | x=x(:); 21 | 22 | if nargin<2 || isempty(fd_bins) 23 | n = length(x); 24 | maxmin_range = max(x)-min(x); 25 | fd_bins = ceil(maxmin_range/(2.0*iqr(x)*n^(-1/3))); % Freedman-Diaconis 26 | end 27 | 28 | %% bin data 29 | 30 | edges = linspace(min(x),max(x),fd_bins+1); 31 | [nPerBin1,bins1] = histc(x,edges); 32 | 33 | %% compute entropies 34 | 35 | % recompute entropy with optimal bins for comparison 36 | hdat1 = hist(x,fd_bins); 37 | hdat1 = hdat1./sum(hdat1); 38 | 39 | % convert histograms to probability values 40 | entropy = -sum(hdat1.*log2(hdat1+eps)); 41 | 42 | %% 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/code/erpviewerx.fig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/AnalyzingNeuralTimeSeriesData/code/erpviewerx.fig -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/code/fdr.m: -------------------------------------------------------------------------------- 1 | function [pID,pN] = fdr(p,q) 2 | % FORMAT [pID,pN] = fdr(p,q) 3 | % 4 | % p - vector of p-values 5 | % q - False Discovery Rate level 6 | % 7 | % pID - p-value threshold based on independence or positive dependence 8 | % pN - Nonparametric p-value threshold 9 | %______________________________________________________________________________ 10 | % $Id: FDR.m,v 1.1 2009/10/20 09:04:30 nichols Exp $ 11 | 12 | 13 | p = p(isfinite(p)); % Toss NaN's 14 | p = sort(p(:)); 15 | V = length(p); 16 | I = (1:V)'; 17 | 18 | cVID = 1; 19 | cVN = sum(1./(1:V)); 20 | 21 | pID = p(find(p<=I/V*q/cVID,1,'last' )); 22 | pN = p(find(p<=I/V*q/cVN, 1,'last' )); 23 | -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/code/figure34_3_data.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/AnalyzingNeuralTimeSeriesData/code/figure34_3_data.mat -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/code/my_matlab_variables.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/AnalyzingNeuralTimeSeriesData/code/my_matlab_variables.mat -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/code/pathlength.m: -------------------------------------------------------------------------------- 1 | function Plength = pathlength(A) 2 | 3 | % PATHLENGTH Calculate minimum pathlengths for a given adjacency 4 | % matrix. 5 | % 6 | % Input A: n by n adjacency matrix (symmetric). 7 | % 8 | % Output Plength: n by n matrix of pathlengths. Element in 9 | % position (i,j) is pathlength from node i to node j. 10 | % If no path exists, inf is returned. 11 | % 12 | % Description: Powers up the adjacency matrix until either there are 13 | % no elements equal to zero or the (n-1)st power has been 14 | % reached. Records the first power at which (i,j) element 15 | % became nonzero. 16 | % 17 | % Example: Plength = pathlength(A); 18 | % 19 | 20 | % This function was downloaded from the following reference: 21 | % Taylor, A., and D.J. Higham. "Contest: A Controllable Test Matrix Toolbox for % Matlab." ACM Transactions on Mathematical Software (TOMS) 35, no. 4 22 | % (2009): 1-16. 23 | % 24 | 25 | Anew = A; 26 | n = length(A); 27 | power = 1; 28 | Plength = sign(A + eye(n,n)); % record all paths of length one, including diagonal 29 | 30 | while any(any(Anew==0)) && power <= (n-1) 31 | power = power + 1; 32 | Anew = Anew*A; 33 | Plength = Plength + ( (Plength == 0) & (Anew > 0) )*power; 34 | end 35 | 36 | Plength(Plength==0) = inf; % reset zeros to inf 37 | 38 | Plength = Plength - diag(diag(Plength)); % reset diagonal to zero -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/code/sampleEEGdata.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/AnalyzingNeuralTimeSeriesData/code/sampleEEGdata.mat -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/code/solutions2exercises.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/AnalyzingNeuralTimeSeriesData/code/solutions2exercises.pdf -------------------------------------------------------------------------------- /AnalyzingNeuralTimeSeriesData/code/tfviewerx.fig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/AnalyzingNeuralTimeSeriesData/code/tfviewerx.fig -------------------------------------------------------------------------------- /CellArrayOfStruct2Table.m: -------------------------------------------------------------------------------- 1 | % convert cell array of similar structures to table 2 | 3 | % data=load([dataset '.mat']); %cDn_cmdata.mat top_cortex_cmdata.mat 4 | data.cmdata.alldb=cellfun(@(x) struct2table(x), data.cmdata.alldb,'UniformOutput',false); 5 | data.cmdata.alldb=vertcat(data.cmdata.alldb{:}); 6 | 7 | % save(dataset,'data','-v7.3') -------------------------------------------------------------------------------- /FigViewer/FigViewer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/FigViewer/FigViewer.exe -------------------------------------------------------------------------------- /FigViewer/FigViewer.m: -------------------------------------------------------------------------------- 1 | % to compile into a standalone Figure viewer, run: 2 | % mcc -m -v FigViewer.m 3 | 4 | [fileName,dirPath] = uigetfile('*.fig','Select a figure (.fig) file'); 5 | if any(fileName) 6 | openfig(fullfile(dirPath,fileName)); 7 | end 8 | -------------------------------------------------------------------------------- /FigViewer/FigViewer/PackagingLog.html: -------------------------------------------------------------------------------- 1 |
2 | mcc -o FigViewer -W WinMain:FigViewer -T link:exe -d V:\Code\Tools\tools\FigViewer\FigViewer\for_testing -v V:\Code\Tools\tools\FigViewer\FigViewer.m -r 'V:\Program Files\MATLAB\R2019a\toolbox\compiler\Resources\default_icon.ico' 3 | Compiler version: 7.0.1 (R2019a) 4 | 5 | Dependency analysis by REQUIREMENTS. 6 | 7 | Parsing file "V:\Code\Tools\tools\FigViewer\FigViewer.m" 8 | (referenced from command line). 9 | Generating file "V:\Code\Tools\tools\FigViewer\FigViewer\for_testing\readme.txt". 10 | Packaging... 11 | Creating the bundle... 12 | Creating the install agent URL file... 13 | Web based installer created at V:\Code\Tools\tools\FigViewer\FigViewer\for_redistribution\MyAppInstaller_web.exe. 14 | Packaging complete. 15 | Elapsed packaging time was: 5 seconds. 16 |17 | -------------------------------------------------------------------------------- /FigViewer/FigViewer/for_redistribution/MyAppInstaller_web.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/FigViewer/FigViewer/for_redistribution/MyAppInstaller_web.exe -------------------------------------------------------------------------------- /FigViewer/FigViewer/for_redistribution_files_only/FigViewer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/FigViewer/FigViewer/for_redistribution_files_only/FigViewer.exe -------------------------------------------------------------------------------- /FigViewer/FigViewer/for_redistribution_files_only/readme.txt: -------------------------------------------------------------------------------- 1 | FigViewer Executable 2 | 3 | 1. Prerequisites for Deployment 4 | 5 | Verify that version 9.6 (R2019a) of the MATLAB Runtime is installed. 6 | If not, you can run the MATLAB Runtime installer. 7 | To find its location, enter 8 | 9 | >>mcrinstaller 10 | 11 | at the MATLAB prompt. 12 | NOTE: You will need administrator rights to run the MATLAB Runtime installer. 13 | 14 | Alternatively, download and install the Windows version of the MATLAB Runtime for R2019a 15 | from the following link on the MathWorks website: 16 | 17 | http://www.mathworks.com/products/compiler/mcr/index.html 18 | 19 | For more information about the MATLAB Runtime and the MATLAB Runtime installer, see 20 | "Distribute Applications" in the MATLAB Compiler documentation 21 | in the MathWorks Documentation Center. 22 | 23 | 2. Files to Deploy and Package 24 | 25 | Files to Package for Standalone 26 | ================================ 27 | -FigViewer.exe 28 | -MCRInstaller.exe 29 | Note: if end users are unable to download the MATLAB Runtime using the 30 | instructions in the previous section, include it when building your 31 | component by clicking the "Runtime included in package" link in the 32 | Deployment Tool. 33 | -This readme file 34 | 35 | 36 | 37 | 3. Definitions 38 | 39 | For information on deployment terminology, go to 40 | http://www.mathworks.com/help and select MATLAB Compiler > 41 | Getting Started > About Application Deployment > 42 | Deployment Product Terms in the MathWorks Documentation 43 | Center. 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /FigViewer/FigViewer/for_redistribution_files_only/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/FigViewer/FigViewer/for_redistribution_files_only/splash.png -------------------------------------------------------------------------------- /FigViewer/FigViewer/for_testing/FigViewer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/FigViewer/FigViewer/for_testing/FigViewer.exe -------------------------------------------------------------------------------- /FigViewer/FigViewer/for_testing/mccExcludedFiles.log: -------------------------------------------------------------------------------- 1 | The List of Excluded Files 2 | Excluded files Exclusion Message ID Reason For Exclusion Exclusion Rule 3 | -------------------------------------------------------------------------------- /FigViewer/FigViewer/for_testing/readme.txt: -------------------------------------------------------------------------------- 1 | FigViewer Executable 2 | 3 | 1. Prerequisites for Deployment 4 | 5 | Verify that version 9.6 (R2019a) of the MATLAB Runtime is installed. 6 | If not, you can run the MATLAB Runtime installer. 7 | To find its location, enter 8 | 9 | >>mcrinstaller 10 | 11 | at the MATLAB prompt. 12 | NOTE: You will need administrator rights to run the MATLAB Runtime installer. 13 | 14 | Alternatively, download and install the Windows version of the MATLAB Runtime for R2019a 15 | from the following link on the MathWorks website: 16 | 17 | http://www.mathworks.com/products/compiler/mcr/index.html 18 | 19 | For more information about the MATLAB Runtime and the MATLAB Runtime installer, see 20 | "Distribute Applications" in the MATLAB Compiler documentation 21 | in the MathWorks Documentation Center. 22 | 23 | 2. Files to Deploy and Package 24 | 25 | Files to Package for Standalone 26 | ================================ 27 | -FigViewer.exe 28 | -MCRInstaller.exe 29 | Note: if end users are unable to download the MATLAB Runtime using the 30 | instructions in the previous section, include it when building your 31 | component by clicking the "Runtime included in package" link in the 32 | Deployment Tool. 33 | -This readme file 34 | 35 | 36 | 37 | 3. Definitions 38 | 39 | For information on deployment terminology, go to 40 | http://www.mathworks.com/help and select MATLAB Compiler > 41 | Getting Started > About Application Deployment > 42 | Deployment Product Terms in the MathWorks Documentation 43 | Center. 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /FigViewer/FigViewer/for_testing/requiredMCRProducts.txt: -------------------------------------------------------------------------------- 1 | 35010 35000 -------------------------------------------------------------------------------- /FigViewer/FigViewer/for_testing/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/FigViewer/FigViewer/for_testing/splash.png -------------------------------------------------------------------------------- /FigViewer/mccExcludedFiles.log: -------------------------------------------------------------------------------- 1 | The List of Excluded Files 2 | Excluded files Exclusion Message ID Reason For Exclusion Exclusion Rule 3 | -------------------------------------------------------------------------------- /FigViewer/readme.txt: -------------------------------------------------------------------------------- 1 | FigViewer Executable 2 | 3 | 1. Prerequisites for Deployment 4 | 5 | Verify that version 9.6 (R2019a) of the MATLAB Runtime is installed. 6 | If not, you can run the MATLAB Runtime installer. 7 | To find its location, enter 8 | 9 | >>mcrinstaller 10 | 11 | at the MATLAB prompt. 12 | NOTE: You will need administrator rights to run the MATLAB Runtime installer. 13 | 14 | Alternatively, download and install the Windows version of the MATLAB Runtime for R2019a 15 | from the following link on the MathWorks website: 16 | 17 | http://www.mathworks.com/products/compiler/mcr/index.html 18 | 19 | For more information about the MATLAB Runtime and the MATLAB Runtime installer, see 20 | "Distribute Applications" in the MATLAB Compiler documentation 21 | in the MathWorks Documentation Center. 22 | 23 | 2. Files to Deploy and Package 24 | 25 | Files to Package for Standalone 26 | ================================ 27 | -FigViewer.exe 28 | -MCRInstaller.exe 29 | Note: if end users are unable to download the MATLAB Runtime using the 30 | instructions in the previous section, include it when building your 31 | component by clicking the "Runtime included in package" link in the 32 | Deployment Tool. 33 | -This readme file 34 | 35 | 36 | 37 | 3. Definitions 38 | 39 | For information on deployment terminology, go to 40 | http://www.mathworks.com/help and select MATLAB Compiler > 41 | Getting Started > About Application Deployment > 42 | Deployment Product Terms in the MathWorks Documentation 43 | Center. 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /FigViewer/requiredMCRProducts.txt: -------------------------------------------------------------------------------- 1 | 35010 35000 -------------------------------------------------------------------------------- /Gdatatheor/README: -------------------------------------------------------------------------------- 1 | These files should be placed in the directory bookchap containing the 2 | basic simulation package. 3 | -------------------------------------------------------------------------------- /GenNoisySig.m: -------------------------------------------------------------------------------- 1 | function noisySig=GenNoisySig(sigDur,sigFreq,sampFreq,phaseShift,numCh) 2 | 3 | % parameters 4 | % sigDur = 3; % Duration (sec) 5 | % sigFreq = 9; % Frequency (Hz) 6 | % sampFreq = 250; % Sampling Frequency (Hz) 7 | % phaseShift = pi/2; 8 | sigAmp = 3; 9 | sigOffset = 0; %1.5; 10 | noiseAmp = 0.5; 11 | 12 | timeVec = linspace(0, sigDur, sampFreq*sigDur); % Time Vector 13 | 14 | % sampInterv = 1/sampFreq; 15 | % timeVec = 0:sampInterv:1-sampInterv; % 1s signal 16 | 17 | %generate signal 18 | for chNum=1:numCh 19 | sig = sigOffset + sigAmp*sin(((2*pi*sigFreq*timeVec))+(phaseShift*chNum)); % % Signal (10 kHz sine) 20 | noisySig(chNum,:) = sig + noiseAmp*(randn(size(sig)));%-0.5 21 | end 22 | 23 | % figure; hold on 24 | % plot(noisySig(1,:)) 25 | % plot(noisySig(end,:)) 26 | 27 | % figure; 28 | % imagesc(noisySig) 29 | 30 | 31 | %% cool effects: 32 | % for chNum=1:64 33 | % sig = sigOffset + sigAmp*sin(2*(pi+0.5*chNum*pi)*sigFreq*timeVec); % Signal (10 kHz sine) 34 | % noisySig(chNum,:) = sig + noiseAmp*(randn(size(sig))-0.5); 35 | % end 36 | % 37 | 38 | % for chNum=1:64 39 | % sig = sigOffset + sigAmp*sin((2*pi+0.5*chNum)*sigFreq*timeVec); % Signal (10 kHz sine) 40 | % noisySig(chNum,:) = sig + noiseAmp*(randn(size(sig))-0.5); 41 | % end 42 | 43 | % for chNum=1:64 44 | % sig = sigOffset + sigAmp*sin(((2*pi*sigFreq)+(pi/2*chNum))*timeVec); % Signal (10 kHz sine) 45 | % noisySig(chNum,:) = sig + noiseAmp*(randn(size(sig))-0.5); 46 | % end 47 | % 48 | % figure; 49 | % imagesc(noisySig) -------------------------------------------------------------------------------- /ImportJRClusSortInfo.m: -------------------------------------------------------------------------------- 1 | function clusterInfo = ImportJRClusSortInfo(filename, startRow, endRow) 2 | % import JRCLus cluster info (spike time, cluster #, max site#) from csv 3 | % file 4 | 5 | %% Initialize variables. 6 | delimiter = ','; 7 | if nargin<=2 8 | startRow = 1; 9 | endRow = inf; 10 | end 11 | 12 | %% Format for each line of text: 13 | formatSpec = '%f%f%f%[^\n\r]'; 14 | 15 | %% Open the text file. 16 | fileID = fopen(filename,'r'); 17 | 18 | %% Read columns of data according to the format. 19 | dataArray = textscan(fileID, formatSpec, endRow(1)-startRow(1)+1, 'Delimiter', delimiter, 'TextType', 'string', 'EmptyValue', NaN, 'HeaderLines', startRow(1)-1, 'ReturnOnError', false, 'EndOfLine', '\r\n'); 20 | for block=2:length(startRow) 21 | frewind(fileID); 22 | dataArrayBlock = textscan(fileID, formatSpec, endRow(block)-startRow(block)+1, 'Delimiter', delimiter, 'TextType', 'string', 'EmptyValue', NaN, 'HeaderLines', startRow(block)-1, 'ReturnOnError', false, 'EndOfLine', '\r\n'); 23 | for col=1:length(dataArray) 24 | dataArray{col} = [dataArray{col};dataArrayBlock{col}]; 25 | end 26 | end 27 | 28 | %% Close the text file. 29 | fclose(fileID); 30 | 31 | %% Create output variable 32 | clusterInfo = table(dataArray{1:end-1}, 'VariableNames', {'timeStamps','clusterNum','bestSite'}); 33 | 34 | -------------------------------------------------------------------------------- /InhCumWeib.m: -------------------------------------------------------------------------------- 1 | function [Inhibition] = InhCumWeib(Params,Data) 2 | %% InhCumWeib 3 | % Fun(gama,XData,alpha,beta,delta) = gama-((exp(-((XData./alpha).^beta))).*(gama-delta)) 4 | % Params: Initial Guess [alpha beta gamma delta]; 5 | 6 | % 1. Get data 7 | if length(Params)<3 8 | Params(3)=1; Params(4)=0; 9 | end 10 | 11 | % 2. Compute Values 12 | % Inhibition = 1 - (Params(3)-((exp(-((Data./Params(1)).^Params(2)))).*(Params(3)-Params(4)))); 13 | 14 | % L Boucher made the following change from the above equation. 15 | Inhibition = (Params(3)-((exp(-((Data./Params(1)).^Params(2)))).*(Params(3)-Params(4)))); -------------------------------------------------------------------------------- /MahalClusDist.m: -------------------------------------------------------------------------------- 1 | 2 | % first tests 3 | load('testexport.mat', 'H66L4A4_22690_stim_Ch2') 4 | waveforms_cls1=H66L4A4_22690_stim_Ch2.values(H66L4A4_22690_stim_Ch2.codes(:,1)==1,:); 5 | waveforms_cls2=H66L4A4_22690_stim_Ch2.values(H66L4A4_22690_stim_Ch2.codes(:,1)==2,:); 6 | PC_cls1=pca(waveforms_cls1); 7 | PC_cls2=pca(waveforms_cls2); 8 | figure 9 | plot(PC_cls1(:,1)) 10 | hold on 11 | plot(PC_cls2(:,1),'r') 12 | figure 13 | plot(waveforms_cls1(1,:)) 14 | hold on 15 | plot(waveforms_cls1(2,:)) 16 | plot(waveforms_cls1(60000,:)) 17 | 18 | % now importing text files saved from Spike2 PCA window (just keep values) 19 | 20 | figure 21 | d = mahal(Clus2,Clus1); 22 | scatter3(Clus1(:,1),Clus1(:,2),Clus1(:,3),10,'o') 23 | hold on 24 | scatter3(Clus2(:,1),Clus2(:,2),Clus2(:,3),10,d,'*','LineWidth',2) 25 | hb = colorbar; 26 | ylabel(hb,'Mahalanobis Distance') 27 | legend('Cluster1','Cluster2','Cluster3','Location','NW') 28 | 29 | 30 | % comparing across epochs 31 | 32 | Clus1=PCAvalues(cluscodes==1,:); 33 | Clus1_s1=Clus1(1:ceil(size(Clus1,1)/3),:); 34 | Clus1_s2=Clus1(ceil(size(Clus1,1)/3)+1:ceil(size(Clus1,1)/3*2),:); 35 | % Clus1_s3=Clus1(ceil(size(Clus1,1)/3*2)+1:end,:); 36 | d1vs1 = mahal(Clus1_s1,Clus1_s1); 37 | d2vs1 = mahal(Clus1_s2,Clus1_s1); 38 | 39 | olvals=d2vs1(d2vs1>(mean(d1vs1)+2.5*std(d1vs1))); -------------------------------------------------------------------------------- /MakeASCII4.m: -------------------------------------------------------------------------------- 1 | function MakeASCII4(whichfile, whatch) 2 | load([whichfile '.mat']); 3 | eval(['data = ' whichfile '_Ch' num2str(whatch,'%d')]); 4 | 5 | FID = fopen([whichfile '.txt'], 'w'); 6 | eno = 0; 7 | fprintf(FID, '%d\t%d\tet\n',25,data.items); 8 | data.times = round(data.times.*50000); 9 | data.values = abs(data.values); 10 | for a = 1:25 11 | newrow = []; 12 | for b = 1:data.items 13 | if (b == data.items) 14 | newrow = [newrow sprintf('%7.7f',data.values(a,b))]; 15 | else 16 | newrow = [newrow sprintf('%7.7f\t',data.values(a,b))]; 17 | end 18 | end 19 | if a == 25 20 | fprintf(FID, ['%d\t%d\t' newrow],eno,data.times(a)); 21 | else 22 | fprintf(FID, ['%d\t%d\t' newrow '\n'],eno,data.times(a)); 23 | %keyboard; 24 | end 25 | end 26 | fclose(FID); 27 | %keyboard; 28 | end -------------------------------------------------------------------------------- /Matlab2Goog/README.txt: -------------------------------------------------------------------------------- 1 | 2011/04/27 2 | This set of matlab functions will allow creating 3 | Google spreadsheets, adding worksheets to them, modifying the 4 | worksheets, and placing data in them. The delete worksheet 5 | function works intermittently so far (the DELETE request throws 6 | 400/Bad request sometimes). 7 | 8 | Please see Matlab2GoogTest.m for sample usage (you'll need to 9 | enter your gmail username/password). 10 | 11 | Please note that you need to have urlreadwrite.m (unmodified as 12 | available in the Matlab distribution in 13 | MATLABROOT/toolbox/matlab/iofun/private/urlreadwrite.m) on your 14 | path. 15 | 16 | This was very much inspired by submission of Ofir Bibi (Create 17 | Google Calendar event with SMS and Email notification, File ID: 18 | #25698). 19 | 20 | 2011/6/20 21 | The Google login box was inspired by submission of Matt Fig (41 22 | Complete GUI Examples, File ID: #24861). Some of the code was 23 | somewhat simplified, there is a new function, getWorksheetCell, 24 | that reads both the cell value and the forumula. editWorksheetCell 25 | supports entering formulas as string (see Google Spreadsheet 26 | API for examples). 27 | -------------------------------------------------------------------------------- /Matlab2Goog/deleteSpreadsheet.m: -------------------------------------------------------------------------------- 1 | function deleteSpreadsheet(spreadsheetKey,aToken) 2 | import java.io.*; 3 | import java.net.*; 4 | import java.lang.*; 5 | com.mathworks.mlwidgets.html.HTMLPrefs.setProxySettings; 6 | 7 | MAXITER=10; 8 | success=false; 9 | 10 | getURLStringList=['https://docs.google.com/feeds/default/private/full/' spreadsheetKey '?delete=true']; 11 | safeguard=0; 12 | while (~success && safeguard
ConnectionMonitor
is used to get notified when the
6 | * underlying socket of a connection is closed.
7 | *
8 | * @author Christian Plattner
9 | * @version 2.50, 03/15/10
10 | */
11 |
12 | public interface ConnectionMonitor
13 | {
14 | /**
15 | * This method is called after the connection's underlying
16 | * socket has been closed. E.g., due to the {@link Connection#close()} request of the
17 | * user, if the peer closed the connection, due to a fatal error during connect()
18 | * (also if the socket cannot be established) or if a fatal error occured on
19 | * an established connection.
20 | * 21 | * This is an experimental feature. 22 | *
23 | * You MUST NOT make any assumption about the thread that invokes this method. 24 | *
25 | * Please note: if the connection is not connected (e.g., there was no successful
26 | * connect() call), then the invocation of {@link Connection#close()} will NOT trigger
27 | * this method.
28 | *
29 | * @see Connection#addConnectionMonitor(ConnectionMonitor)
30 | *
31 | * @param reason Includes an indication why the socket was closed.
32 | */
33 | public void connectionLost(Throwable reason);
34 | }
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/HTTPProxyException.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2;
3 |
4 | import java.io.IOException;
5 |
6 | /**
7 | * May be thrown upon connect() if a HTTP proxy is being used.
8 | *
9 | * @see Connection#connect()
10 | * @see Connection#setProxyData(ProxyData)
11 | *
12 | * @author Christian Plattner
13 | * @version 2.50, 03/15/10
14 | */
15 |
16 | public class HTTPProxyException extends IOException
17 | {
18 | private static final long serialVersionUID = 2241537397104426186L;
19 |
20 | public final String httpResponse;
21 | public final int httpErrorCode;
22 |
23 | public HTTPProxyException(String httpResponse, int httpErrorCode)
24 | {
25 | super("HTTP Proxy Error (" + httpErrorCode + " " + httpResponse + ")");
26 | this.httpResponse = httpResponse;
27 | this.httpErrorCode = httpErrorCode;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/ProxyData.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2;
3 |
4 | /**
5 | * An abstract marker interface implemented by all proxy data implementations.
6 | *
7 | * @see HTTPProxyData
8 | *
9 | * @author Christian Plattner
10 | * @version 2.50, 03/15/10
11 | */
12 |
13 | public abstract interface ProxyData
14 | {
15 | }
16 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/SFTPv3DirectoryEntry.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2;
3 |
4 | /**
5 | * A SFTPv3DirectoryEntry
as returned by {@link SFTPv3Client#ls(String)}.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 |
11 | public class SFTPv3DirectoryEntry
12 | {
13 | /**
14 | * A relative name within the directory, without any path components.
15 | */
16 | public String filename;
17 |
18 | /**
19 | * An expanded format for the file name, similar to what is returned by
20 | * "ls -l" on Un*x systems.
21 | *
22 | * The format of this field is unspecified by the SFTP v3 protocol. 23 | * It MUST be suitable for use in the output of a directory listing 24 | * command (in fact, the recommended operation for a directory listing 25 | * command is to simply display this data). However, clients SHOULD NOT 26 | * attempt to parse the longname field for file attributes; they SHOULD 27 | * use the attrs field instead. 28 | *
29 | * The recommended format for the longname field is as follows:
30 | * -rwxr-xr-x 1 mjos staff 348911 Mar 25 14:29 t-filexfer
31 | */
32 | public String longEntry;
33 |
34 | /**
35 | * The attributes of this entry.
36 | */
37 | public SFTPv3FileAttributes attributes;
38 | }
39 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/SFTPv3FileHandle.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2;
3 |
4 | /**
5 | * A SFTPv3FileHandle
.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 |
11 | public class SFTPv3FileHandle
12 | {
13 | final SFTPv3Client client;
14 | final byte[] fileHandle;
15 | boolean isClosed = false;
16 |
17 | /* The constructor is NOT public */
18 |
19 | SFTPv3FileHandle(SFTPv3Client client, byte[] h)
20 | {
21 | this.client = client;
22 | this.fileHandle = h;
23 | }
24 |
25 | /**
26 | * Get the SFTPv3Client instance which created this handle.
27 | *
28 | * @return A SFTPv3Client instance.
29 | */
30 | public SFTPv3Client getClient()
31 | {
32 | return client;
33 | }
34 |
35 | /**
36 | * Check if this handle was closed with the {@link SFTPv3Client#closeFile(SFTPv3FileHandle)} method
37 | * of the SFTPv3Client
instance which created the handle.
38 | *
39 | * @return if the handle is closed.
40 | */
41 | public boolean isClosed()
42 | {
43 | return isClosed;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/ServerHostKeyVerifier.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2;
3 |
4 | /**
5 | * A callback interface used to implement a client specific method of checking
6 | * server host keys.
7 | *
8 | * @author Christian Plattner
9 | * @version 2.50, 03/15/10
10 | */
11 |
12 | public interface ServerHostKeyVerifier
13 | {
14 | /**
15 | * The actual verifier method, it will be called by the key exchange code
16 | * on EVERY key exchange - this can happen several times during the lifetime
17 | * of a connection.
18 | *
19 | * Note: SSH-2 servers are allowed to change their hostkey at ANY time.
20 | *
21 | * @param hostname the hostname used to create the {@link Connection} object
22 | * @param port the remote TCP port
23 | * @param serverHostKeyAlgorithm the public key algorithm (ssh-rsa
or ssh-dss
)
24 | * @param serverHostKey the server's public key blob
25 | * @return if the client wants to accept the server's host key - if not, the
26 | * connection will be closed.
27 | * @throws Exception Will be wrapped with an IOException, extended version of returning false =)
28 | */
29 | public boolean verifyServerHostKey(String hostname, int port, String serverHostKeyAlgorithm, byte[] serverHostKey)
30 | throws Exception;
31 | }
32 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/channel/ChannelOutputStream.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.channel;
2 |
3 | import java.io.IOException;
4 | import java.io.OutputStream;
5 |
6 | /**
7 | * ChannelOutputStream.
8 | *
9 | * @author Christian Plattner
10 | * @version 2.50, 03/15/10
11 | */
12 | public final class ChannelOutputStream extends OutputStream
13 | {
14 | Channel c;
15 |
16 | boolean isClosed = false;
17 |
18 | ChannelOutputStream(Channel c)
19 | {
20 | this.c = c;
21 | }
22 |
23 | public void write(int b) throws IOException
24 | {
25 | byte[] buff = new byte[1];
26 |
27 | buff[0] = (byte) b;
28 |
29 | write(buff, 0, 1);
30 | }
31 |
32 | public void close() throws IOException
33 | {
34 | if (isClosed == false)
35 | {
36 | isClosed = true;
37 | c.cm.sendEOF(c);
38 | }
39 | }
40 |
41 | public void flush() throws IOException
42 | {
43 | if (isClosed)
44 | throw new IOException("This OutputStream is closed.");
45 |
46 | /* This is a no-op, since this stream is unbuffered */
47 | }
48 |
49 | public void write(byte[] b, int off, int len) throws IOException
50 | {
51 | if (isClosed)
52 | throw new IOException("This OutputStream is closed.");
53 |
54 | if (b == null)
55 | throw new NullPointerException();
56 |
57 | if ((off < 0) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0) || (off > b.length))
58 | throw new IndexOutOfBoundsException();
59 |
60 | if (len == 0)
61 | return;
62 |
63 | c.cm.sendData(c, b, off, len);
64 | }
65 |
66 | public void write(byte[] b) throws IOException
67 | {
68 | write(b, 0, b.length);
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/channel/IChannelWorkerThread.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.channel;
3 |
4 | /**
5 | * IChannelWorkerThread.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 | interface IChannelWorkerThread
11 | {
12 | public void stopWorking();
13 | }
14 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/channel/RemoteForwardingData.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.channel;
3 |
4 | /**
5 | * RemoteForwardingData. Data about a requested remote forwarding.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 | public class RemoteForwardingData
11 | {
12 | public String bindAddress;
13 | public int bindPort;
14 |
15 | String targetAddress;
16 | int targetPort;
17 | }
18 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/channel/X11ServerData.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.channel;
3 |
4 | /**
5 | * X11ServerData. Data regarding an x11 forwarding target.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | *
10 | */
11 | public class X11ServerData
12 | {
13 | public String hostname;
14 | public int port;
15 | public byte[] x11_magic_cookie; /* not the remote (fake) one, the local (real) one */
16 | }
17 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/crypto/CryptoWishList.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.crypto;
3 |
4 | import ch.ethz.ssh2.crypto.cipher.BlockCipherFactory;
5 | import ch.ethz.ssh2.crypto.digest.MAC;
6 | import ch.ethz.ssh2.transport.KexManager;
7 |
8 | /**
9 | * CryptoWishList.
10 | *
11 | * @author Christian Plattner
12 | * @version 2.50, 03/15/10
13 | */
14 | public class CryptoWishList
15 | {
16 | public String[] kexAlgorithms = KexManager.getDefaultKexAlgorithmList();
17 | public String[] serverHostKeyAlgorithms = KexManager.getDefaultServerHostkeyAlgorithmList();
18 | public String[] c2s_enc_algos = BlockCipherFactory.getDefaultCipherList();
19 | public String[] s2c_enc_algos = BlockCipherFactory.getDefaultCipherList();
20 | public String[] c2s_mac_algos = MAC.getMacList();
21 | public String[] s2c_mac_algos = MAC.getMacList();
22 | }
23 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/crypto/PEMStructure.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.crypto;
3 |
4 | /**
5 | * Parsed PEM structure.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 |
11 | public class PEMStructure
12 | {
13 | int pemType;
14 | String dekInfo[];
15 | String procType[];
16 | byte[] data;
17 | }
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/crypto/cipher/BlockCipher.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.crypto.cipher;
2 |
3 | /**
4 | * BlockCipher.
5 | *
6 | * @author Christian Plattner
7 | * @version 2.50, 03/15/10
8 | */
9 | public interface BlockCipher
10 | {
11 | public void init(boolean forEncryption, byte[] key);
12 |
13 | public int getBlockSize();
14 |
15 | public void transformBlock(byte[] src, int srcoff, byte[] dst, int dstoff);
16 | }
17 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/crypto/cipher/CTRMode.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.crypto.cipher;
3 |
4 | /**
5 | * This is CTR mode as described in draft-ietf-secsh-newmodes-XY.txt
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 | public class CTRMode implements BlockCipher
11 | {
12 | byte[] X;
13 | byte[] Xenc;
14 |
15 | BlockCipher bc;
16 | int blockSize;
17 | boolean doEncrypt;
18 |
19 | int count = 0;
20 |
21 | public void init(boolean forEncryption, byte[] key)
22 | {
23 | }
24 |
25 | public CTRMode(BlockCipher tc, byte[] iv, boolean doEnc) throws IllegalArgumentException
26 | {
27 | bc = tc;
28 | blockSize = bc.getBlockSize();
29 | doEncrypt = doEnc;
30 |
31 | if (blockSize != iv.length)
32 | throw new IllegalArgumentException("IV must be " + blockSize + " bytes long! (currently " + iv.length + ")");
33 |
34 | X = new byte[blockSize];
35 | Xenc = new byte[blockSize];
36 |
37 | System.arraycopy(iv, 0, X, 0, blockSize);
38 | }
39 |
40 | public final int getBlockSize()
41 | {
42 | return blockSize;
43 | }
44 |
45 | public final void transformBlock(byte[] src, int srcoff, byte[] dst, int dstoff)
46 | {
47 | bc.transformBlock(X, 0, Xenc, 0);
48 |
49 | for (int i = 0; i < blockSize; i++)
50 | {
51 | dst[dstoff + i] = (byte) (src[srcoff + i] ^ Xenc[i]);
52 | }
53 |
54 | for (int i = (blockSize - 1); i >= 0; i--)
55 | {
56 | X[i]++;
57 | if (X[i] != 0)
58 | break;
59 |
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/crypto/cipher/NullCipher.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.crypto.cipher;
2 |
3 | /**
4 | * NullCipher.
5 | *
6 | * @author Christian Plattner
7 | * @version 2.50, 03/15/10
8 | */
9 | public class NullCipher implements BlockCipher
10 | {
11 | private int blockSize = 8;
12 |
13 | public NullCipher()
14 | {
15 | }
16 |
17 | public NullCipher(int blockSize)
18 | {
19 | this.blockSize = blockSize;
20 | }
21 |
22 | public void init(boolean forEncryption, byte[] key)
23 | {
24 | }
25 |
26 | public int getBlockSize()
27 | {
28 | return blockSize;
29 | }
30 |
31 | public void transformBlock(byte[] src, int srcoff, byte[] dst, int dstoff)
32 | {
33 | System.arraycopy(src, srcoff, dst, dstoff, blockSize);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/crypto/digest/Digest.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.crypto.digest;
3 |
4 | /**
5 | * Digest.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 | public interface Digest
11 | {
12 | public int getDigestLength();
13 |
14 | public void update(byte b);
15 |
16 | public void update(byte[] b);
17 |
18 | public void update(byte b[], int off, int len);
19 |
20 | public void reset();
21 |
22 | public void digest(byte[] out);
23 |
24 | public void digest(byte[] out, int off);
25 | }
26 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/log/Logger.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.log;
3 |
4 | /**
5 | * Logger - a very simple logger, mainly used during development.
6 | * Is not based on log4j (to reduce external dependencies).
7 | * However, if needed, something like log4j could easily be
8 | * hooked in.
9 | *
10 | * @author Christian Plattner
11 | * @version 2.50, 03/15/10
12 | */
13 |
14 | public class Logger
15 | {
16 | private static final boolean enabled = false;
17 | private static final int logLevel = 99;
18 |
19 | private String className;
20 |
21 | public final static Logger getLogger(Class x)
22 | {
23 | return new Logger(x);
24 | }
25 |
26 | public Logger(Class x)
27 | {
28 | this.className = x.getName();
29 | }
30 |
31 | public final boolean isEnabled()
32 | {
33 | return enabled;
34 | }
35 |
36 | public final void log(int level, String message)
37 | {
38 | if ((enabled) && (level <= logLevel))
39 | {
40 | long now = System.currentTimeMillis();
41 |
42 | synchronized (this)
43 | {
44 | System.err.println(now + " : " + className + ": " + message);
45 | // or send it to log4j or whatever...
46 | }
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketChannelWindowAdjust.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.packets;
2 |
3 | import java.io.IOException;
4 |
5 | /**
6 | * PacketChannelWindowAdjust.
7 | *
8 | * @author Christian Plattner
9 | * @version 2.50, 03/15/10
10 | */
11 | public class PacketChannelWindowAdjust
12 | {
13 | byte[] payload;
14 |
15 | public int recipientChannelID;
16 | public int windowChange;
17 |
18 | public PacketChannelWindowAdjust(int recipientChannelID, int windowChange)
19 | {
20 | this.recipientChannelID = recipientChannelID;
21 | this.windowChange = windowChange;
22 | }
23 |
24 | public PacketChannelWindowAdjust(byte payload[], int off, int len) throws IOException
25 | {
26 | this.payload = new byte[len];
27 | System.arraycopy(payload, off, this.payload, 0, len);
28 |
29 | TypesReader tr = new TypesReader(payload, off, len);
30 |
31 | int packet_type = tr.readByte();
32 |
33 | if (packet_type != Packets.SSH_MSG_CHANNEL_WINDOW_ADJUST)
34 | throw new IOException(
35 | "This is not a SSH_MSG_CHANNEL_WINDOW_ADJUST! ("
36 | + packet_type + ")");
37 |
38 | recipientChannelID = tr.readUINT32();
39 | windowChange = tr.readUINT32();
40 |
41 | if (tr.remain() != 0)
42 | throw new IOException("Padding in SSH_MSG_CHANNEL_WINDOW_ADJUST packet!");
43 | }
44 |
45 | public byte[] getPayload()
46 | {
47 | if (payload == null)
48 | {
49 | TypesWriter tw = new TypesWriter();
50 | tw.writeByte(Packets.SSH_MSG_CHANNEL_WINDOW_ADJUST);
51 | tw.writeUINT32(recipientChannelID);
52 | tw.writeUINT32(windowChange);
53 | payload = tw.getBytes();
54 | }
55 | return payload;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketDisconnect.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.packets;
2 | import java.io.IOException;
3 |
4 | /**
5 | * PacketDisconnect.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 | public class PacketDisconnect
11 | {
12 | byte[] payload;
13 |
14 | int reason;
15 | String desc;
16 | String lang;
17 |
18 | public PacketDisconnect(byte payload[], int off, int len) throws IOException
19 | {
20 | this.payload = new byte[len];
21 | System.arraycopy(payload, off, this.payload, 0, len);
22 |
23 | TypesReader tr = new TypesReader(payload, off, len);
24 |
25 | int packet_type = tr.readByte();
26 |
27 | if (packet_type != Packets.SSH_MSG_DISCONNECT)
28 | throw new IOException("This is not a Disconnect Packet! ("
29 | + packet_type + ")");
30 |
31 | reason = tr.readUINT32();
32 | desc = tr.readString();
33 | lang = tr.readString();
34 | }
35 |
36 | public PacketDisconnect(int reason, String desc, String lang)
37 | {
38 | this.reason = reason;
39 | this.desc = desc;
40 | this.lang = lang;
41 | }
42 |
43 | public byte[] getPayload()
44 | {
45 | if (payload == null)
46 | {
47 | TypesWriter tw = new TypesWriter();
48 | tw.writeByte(Packets.SSH_MSG_DISCONNECT);
49 | tw.writeUINT32(reason);
50 | tw.writeString(desc);
51 | tw.writeString(lang);
52 | payload = tw.getBytes();
53 | }
54 | return payload;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketGlobalCancelForwardRequest.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.packets;
3 |
4 | /**
5 | * PacketGlobalCancelForwardRequest.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 | public class PacketGlobalCancelForwardRequest
11 | {
12 | byte[] payload;
13 |
14 | public boolean wantReply;
15 | public String bindAddress;
16 | public int bindPort;
17 |
18 | public PacketGlobalCancelForwardRequest(boolean wantReply, String bindAddress, int bindPort)
19 | {
20 | this.wantReply = wantReply;
21 | this.bindAddress = bindAddress;
22 | this.bindPort = bindPort;
23 | }
24 |
25 | public byte[] getPayload()
26 | {
27 | if (payload == null)
28 | {
29 | TypesWriter tw = new TypesWriter();
30 | tw.writeByte(Packets.SSH_MSG_GLOBAL_REQUEST);
31 |
32 | tw.writeString("cancel-tcpip-forward");
33 | tw.writeBoolean(wantReply);
34 | tw.writeString(bindAddress);
35 | tw.writeUINT32(bindPort);
36 |
37 | payload = tw.getBytes();
38 | }
39 | return payload;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketGlobalForwardRequest.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.packets;
3 |
4 | /**
5 | * PacketGlobalForwardRequest.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 | public class PacketGlobalForwardRequest
11 | {
12 | byte[] payload;
13 |
14 | public boolean wantReply;
15 | public String bindAddress;
16 | public int bindPort;
17 |
18 | public PacketGlobalForwardRequest(boolean wantReply, String bindAddress, int bindPort)
19 | {
20 | this.wantReply = wantReply;
21 | this.bindAddress = bindAddress;
22 | this.bindPort = bindPort;
23 | }
24 |
25 | public byte[] getPayload()
26 | {
27 | if (payload == null)
28 | {
29 | TypesWriter tw = new TypesWriter();
30 | tw.writeByte(Packets.SSH_MSG_GLOBAL_REQUEST);
31 |
32 | tw.writeString("tcpip-forward");
33 | tw.writeBoolean(wantReply);
34 | tw.writeString(bindAddress);
35 | tw.writeUINT32(bindPort);
36 |
37 | payload = tw.getBytes();
38 | }
39 | return payload;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketIgnore.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.packets;
3 |
4 | import java.io.IOException;
5 |
6 | /**
7 | * PacketIgnore.
8 | *
9 | * @author Christian Plattner
10 | * @version 2.50, 03/15/10
11 | */
12 | public class PacketIgnore
13 | {
14 | byte[] payload;
15 |
16 | byte[] data;
17 |
18 | public void setData(byte[] data)
19 | {
20 | this.data = data;
21 | payload = null;
22 | }
23 |
24 | public PacketIgnore()
25 | {
26 | }
27 |
28 | public PacketIgnore(byte payload[], int off, int len) throws IOException
29 | {
30 | this.payload = new byte[len];
31 | System.arraycopy(payload, off, this.payload, 0, len);
32 |
33 | TypesReader tr = new TypesReader(payload, off, len);
34 |
35 | int packet_type = tr.readByte();
36 |
37 | if (packet_type != Packets.SSH_MSG_IGNORE)
38 | throw new IOException("This is not a SSH_MSG_IGNORE packet! (" + packet_type + ")");
39 |
40 | /* Could parse String body */
41 | }
42 |
43 | public byte[] getPayload()
44 | {
45 | if (payload == null)
46 | {
47 | TypesWriter tw = new TypesWriter();
48 | tw.writeByte(Packets.SSH_MSG_IGNORE);
49 |
50 | if (data != null)
51 | tw.writeString(data, 0, data.length);
52 | else
53 | tw.writeString("");
54 |
55 | payload = tw.getBytes();
56 | }
57 | return payload;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketKexDHInit.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.packets;
2 |
3 | import java.math.BigInteger;
4 |
5 | /**
6 | * PacketKexDHInit.
7 | *
8 | * @author Christian Plattner
9 | * @version 2.50, 03/15/10
10 | */
11 | public class PacketKexDHInit
12 | {
13 | byte[] payload;
14 |
15 | BigInteger e;
16 |
17 | public PacketKexDHInit(BigInteger e)
18 | {
19 | this.e = e;
20 | }
21 |
22 | public byte[] getPayload()
23 | {
24 | if (payload == null)
25 | {
26 | TypesWriter tw = new TypesWriter();
27 | tw.writeByte(Packets.SSH_MSG_KEXDH_INIT);
28 | tw.writeMPInt(e);
29 | payload = tw.getBytes();
30 | }
31 | return payload;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketKexDHReply.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.packets;
2 |
3 | import java.io.IOException;
4 |
5 | import java.math.BigInteger;
6 |
7 | /**
8 | * PacketKexDHReply.
9 | *
10 | * @author Christian Plattner
11 | * @version 2.50, 03/15/10
12 | */
13 | public class PacketKexDHReply
14 | {
15 | byte[] payload;
16 |
17 | byte[] hostKey;
18 | BigInteger f;
19 | byte[] signature;
20 |
21 | public PacketKexDHReply(byte payload[], int off, int len) throws IOException
22 | {
23 | this.payload = new byte[len];
24 | System.arraycopy(payload, off, this.payload, 0, len);
25 |
26 | TypesReader tr = new TypesReader(payload, off, len);
27 |
28 | int packet_type = tr.readByte();
29 |
30 | if (packet_type != Packets.SSH_MSG_KEXDH_REPLY)
31 | throw new IOException("This is not a SSH_MSG_KEXDH_REPLY! ("
32 | + packet_type + ")");
33 |
34 | hostKey = tr.readByteString();
35 | f = tr.readMPINT();
36 | signature = tr.readByteString();
37 |
38 | if (tr.remain() != 0) throw new IOException("PADDING IN SSH_MSG_KEXDH_REPLY!");
39 | }
40 |
41 | public BigInteger getF()
42 | {
43 | return f;
44 | }
45 |
46 | public byte[] getHostKey()
47 | {
48 | return hostKey;
49 | }
50 |
51 | public byte[] getSignature()
52 | {
53 | return signature;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketKexDhGexGroup.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.packets;
2 |
3 | import java.io.IOException;
4 |
5 | import java.math.BigInteger;
6 |
7 | /**
8 | * PacketKexDhGexGroup.
9 | *
10 | * @author Christian Plattner
11 | * @version 2.50, 03/15/10
12 | */
13 | public class PacketKexDhGexGroup
14 | {
15 | byte[] payload;
16 |
17 | BigInteger p;
18 | BigInteger g;
19 |
20 | public PacketKexDhGexGroup(byte payload[], int off, int len) throws IOException
21 | {
22 | this.payload = new byte[len];
23 | System.arraycopy(payload, off, this.payload, 0, len);
24 |
25 | TypesReader tr = new TypesReader(payload, off, len);
26 |
27 | int packet_type = tr.readByte();
28 |
29 | if (packet_type != Packets.SSH_MSG_KEX_DH_GEX_GROUP)
30 | throw new IllegalArgumentException(
31 | "This is not a SSH_MSG_KEX_DH_GEX_GROUP! (" + packet_type
32 | + ")");
33 |
34 | p = tr.readMPINT();
35 | g = tr.readMPINT();
36 |
37 | if (tr.remain() != 0)
38 | throw new IOException("PADDING IN SSH_MSG_KEX_DH_GEX_GROUP!");
39 | }
40 |
41 | public BigInteger getG()
42 | {
43 | return g;
44 | }
45 |
46 | public BigInteger getP()
47 | {
48 | return p;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketKexDhGexInit.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.packets;
2 |
3 | import java.math.BigInteger;
4 |
5 | /**
6 | * PacketKexDhGexInit.
7 | *
8 | * @author Christian Plattner
9 | * @version 2.50, 03/15/10
10 | */
11 | public class PacketKexDhGexInit
12 | {
13 | byte[] payload;
14 |
15 | BigInteger e;
16 |
17 | public PacketKexDhGexInit(BigInteger e)
18 | {
19 | this.e = e;
20 | }
21 |
22 | public byte[] getPayload()
23 | {
24 | if (payload == null)
25 | {
26 | TypesWriter tw = new TypesWriter();
27 | tw.writeByte(Packets.SSH_MSG_KEX_DH_GEX_INIT);
28 | tw.writeMPInt(e);
29 | payload = tw.getBytes();
30 | }
31 | return payload;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketKexDhGexReply.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.packets;
3 |
4 | import java.io.IOException;
5 |
6 | import java.math.BigInteger;
7 |
8 | /**
9 | * PacketKexDhGexReply.
10 | *
11 | * @author Christian Plattner
12 | * @version 2.50, 03/15/10
13 | */
14 | public class PacketKexDhGexReply
15 | {
16 | byte[] payload;
17 |
18 | byte[] hostKey;
19 | BigInteger f;
20 | byte[] signature;
21 |
22 | public PacketKexDhGexReply(byte payload[], int off, int len) throws IOException
23 | {
24 | this.payload = new byte[len];
25 | System.arraycopy(payload, off, this.payload, 0, len);
26 |
27 | TypesReader tr = new TypesReader(payload, off, len);
28 |
29 | int packet_type = tr.readByte();
30 |
31 | if (packet_type != Packets.SSH_MSG_KEX_DH_GEX_REPLY)
32 | throw new IOException("This is not a SSH_MSG_KEX_DH_GEX_REPLY! (" + packet_type + ")");
33 |
34 | hostKey = tr.readByteString();
35 | f = tr.readMPINT();
36 | signature = tr.readByteString();
37 |
38 | if (tr.remain() != 0)
39 | throw new IOException("PADDING IN SSH_MSG_KEX_DH_GEX_REPLY!");
40 | }
41 |
42 | public BigInteger getF()
43 | {
44 | return f;
45 | }
46 |
47 | public byte[] getHostKey()
48 | {
49 | return hostKey;
50 | }
51 |
52 | public byte[] getSignature()
53 | {
54 | return signature;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketKexDhGexRequest.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.packets;
2 |
3 | import ch.ethz.ssh2.DHGexParameters;
4 |
5 | /**
6 | * PacketKexDhGexRequest.
7 | *
8 | * @author Christian Plattner
9 | * @version 2.50, 03/15/10
10 | */
11 | public class PacketKexDhGexRequest
12 | {
13 | byte[] payload;
14 |
15 | int min;
16 | int n;
17 | int max;
18 |
19 | public PacketKexDhGexRequest(DHGexParameters para)
20 | {
21 | this.min = para.getMin_group_len();
22 | this.n = para.getPref_group_len();
23 | this.max = para.getMax_group_len();
24 | }
25 |
26 | public byte[] getPayload()
27 | {
28 | if (payload == null)
29 | {
30 | TypesWriter tw = new TypesWriter();
31 | tw.writeByte(Packets.SSH_MSG_KEX_DH_GEX_REQUEST);
32 | tw.writeUINT32(min);
33 | tw.writeUINT32(n);
34 | tw.writeUINT32(max);
35 | payload = tw.getBytes();
36 | }
37 | return payload;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketKexDhGexRequestOld.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.packets;
3 |
4 | import ch.ethz.ssh2.DHGexParameters;
5 |
6 | /**
7 | * PacketKexDhGexRequestOld.
8 | *
9 | * @author Christian Plattner
10 | * @version 2.50, 03/15/10
11 | */
12 | public class PacketKexDhGexRequestOld
13 | {
14 | byte[] payload;
15 |
16 | int n;
17 |
18 | public PacketKexDhGexRequestOld(DHGexParameters para)
19 | {
20 | this.n = para.getPref_group_len();
21 | }
22 |
23 | public byte[] getPayload()
24 | {
25 | if (payload == null)
26 | {
27 | TypesWriter tw = new TypesWriter();
28 | tw.writeByte(Packets.SSH_MSG_KEX_DH_GEX_REQUEST_OLD);
29 | tw.writeUINT32(n);
30 | payload = tw.getBytes();
31 | }
32 | return payload;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketNewKeys.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.packets;
2 |
3 | import java.io.IOException;
4 |
5 | /**
6 | * PacketNewKeys.
7 | *
8 | * @author Christian Plattner
9 | * @version 2.50, 03/15/10
10 | */
11 | public class PacketNewKeys
12 | {
13 | byte[] payload;
14 |
15 | public PacketNewKeys()
16 | {
17 | }
18 |
19 | public PacketNewKeys(byte payload[], int off, int len) throws IOException
20 | {
21 | this.payload = new byte[len];
22 | System.arraycopy(payload, off, this.payload, 0, len);
23 |
24 | TypesReader tr = new TypesReader(payload, off, len);
25 |
26 | int packet_type = tr.readByte();
27 |
28 | if (packet_type != Packets.SSH_MSG_NEWKEYS)
29 | throw new IOException("This is not a SSH_MSG_NEWKEYS! ("
30 | + packet_type + ")");
31 |
32 | if (tr.remain() != 0)
33 | throw new IOException("Padding in SSH_MSG_NEWKEYS packet!");
34 | }
35 |
36 | public byte[] getPayload()
37 | {
38 | if (payload == null)
39 | {
40 | TypesWriter tw = new TypesWriter();
41 | tw.writeByte(Packets.SSH_MSG_NEWKEYS);
42 | payload = tw.getBytes();
43 | }
44 | return payload;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketOpenDirectTCPIPChannel.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.packets;
2 |
3 |
4 | /**
5 | * PacketOpenDirectTCPIPChannel.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 | public class PacketOpenDirectTCPIPChannel
11 | {
12 | byte[] payload;
13 |
14 | int channelID;
15 | int initialWindowSize;
16 | int maxPacketSize;
17 |
18 | String host_to_connect;
19 | int port_to_connect;
20 | String originator_IP_address;
21 | int originator_port;
22 |
23 | public PacketOpenDirectTCPIPChannel(int channelID, int initialWindowSize, int maxPacketSize,
24 | String host_to_connect, int port_to_connect, String originator_IP_address,
25 | int originator_port)
26 | {
27 | this.channelID = channelID;
28 | this.initialWindowSize = initialWindowSize;
29 | this.maxPacketSize = maxPacketSize;
30 | this.host_to_connect = host_to_connect;
31 | this.port_to_connect = port_to_connect;
32 | this.originator_IP_address = originator_IP_address;
33 | this.originator_port = originator_port;
34 | }
35 |
36 | public byte[] getPayload()
37 | {
38 | if (payload == null)
39 | {
40 | TypesWriter tw = new TypesWriter();
41 |
42 | tw.writeByte(Packets.SSH_MSG_CHANNEL_OPEN);
43 | tw.writeString("direct-tcpip");
44 | tw.writeUINT32(channelID);
45 | tw.writeUINT32(initialWindowSize);
46 | tw.writeUINT32(maxPacketSize);
47 | tw.writeString(host_to_connect);
48 | tw.writeUINT32(port_to_connect);
49 | tw.writeString(originator_IP_address);
50 | tw.writeUINT32(originator_port);
51 |
52 | payload = tw.getBytes();
53 | }
54 | return payload;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketOpenSessionChannel.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.packets;
2 |
3 | import java.io.IOException;
4 |
5 | /**
6 | * PacketOpenSessionChannel.
7 | *
8 | * @author Christian Plattner
9 | * @version 2.50, 03/15/10
10 | */
11 | public class PacketOpenSessionChannel
12 | {
13 | byte[] payload;
14 |
15 | int channelID;
16 | int initialWindowSize;
17 | int maxPacketSize;
18 |
19 | public PacketOpenSessionChannel(int channelID, int initialWindowSize,
20 | int maxPacketSize)
21 | {
22 | this.channelID = channelID;
23 | this.initialWindowSize = initialWindowSize;
24 | this.maxPacketSize = maxPacketSize;
25 | }
26 |
27 | public PacketOpenSessionChannel(byte payload[], int off, int len) throws IOException
28 | {
29 | this.payload = new byte[len];
30 | System.arraycopy(payload, off, this.payload, 0, len);
31 |
32 | TypesReader tr = new TypesReader(payload);
33 |
34 | int packet_type = tr.readByte();
35 |
36 | if (packet_type != Packets.SSH_MSG_CHANNEL_OPEN)
37 | throw new IOException("This is not a SSH_MSG_CHANNEL_OPEN! ("
38 | + packet_type + ")");
39 |
40 | channelID = tr.readUINT32();
41 | initialWindowSize = tr.readUINT32();
42 | maxPacketSize = tr.readUINT32();
43 |
44 | if (tr.remain() != 0)
45 | throw new IOException("Padding in SSH_MSG_CHANNEL_OPEN packet!");
46 | }
47 |
48 | public byte[] getPayload()
49 | {
50 | if (payload == null)
51 | {
52 | TypesWriter tw = new TypesWriter();
53 | tw.writeByte(Packets.SSH_MSG_CHANNEL_OPEN);
54 | tw.writeString("session");
55 | tw.writeUINT32(channelID);
56 | tw.writeUINT32(initialWindowSize);
57 | tw.writeUINT32(maxPacketSize);
58 | payload = tw.getBytes();
59 | }
60 | return payload;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketServiceAccept.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.packets;
2 |
3 | import java.io.IOException;
4 |
5 | /**
6 | * PacketServiceAccept.
7 | *
8 | * @author Christian Plattner
9 | * @version 2.50, 03/15/10
10 | */
11 | public class PacketServiceAccept
12 | {
13 | byte[] payload;
14 |
15 | String serviceName;
16 |
17 | public PacketServiceAccept(String serviceName)
18 | {
19 | this.serviceName = serviceName;
20 | }
21 |
22 | public PacketServiceAccept(byte payload[], int off, int len) throws IOException
23 | {
24 | this.payload = new byte[len];
25 | System.arraycopy(payload, off, this.payload, 0, len);
26 |
27 | TypesReader tr = new TypesReader(payload, off, len);
28 |
29 | int packet_type = tr.readByte();
30 |
31 | if (packet_type != Packets.SSH_MSG_SERVICE_ACCEPT)
32 | throw new IOException("This is not a SSH_MSG_SERVICE_ACCEPT! ("
33 | + packet_type + ")");
34 |
35 | serviceName = "";
36 |
37 | if (tr.remain() != 0)
38 | {
39 | serviceName = tr.readString();
40 | }
41 | }
42 |
43 | public byte[] getPayload()
44 | {
45 | if (payload == null)
46 | {
47 | TypesWriter tw = new TypesWriter();
48 | tw.writeByte(Packets.SSH_MSG_SERVICE_ACCEPT);
49 | tw.writeString(serviceName);
50 | payload = tw.getBytes();
51 | }
52 | return payload;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketServiceRequest.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.packets;
2 |
3 | import java.io.IOException;
4 |
5 | /**
6 | * PacketServiceRequest.
7 | *
8 | * @author Christian Plattner
9 | * @version 2.50, 03/15/10
10 | */
11 | public class PacketServiceRequest
12 | {
13 | byte[] payload;
14 |
15 | String serviceName;
16 |
17 | public PacketServiceRequest(String serviceName)
18 | {
19 | this.serviceName = serviceName;
20 | }
21 |
22 | public PacketServiceRequest(byte payload[], int off, int len) throws IOException
23 | {
24 | this.payload = new byte[len];
25 | System.arraycopy(payload, off, this.payload, 0, len);
26 |
27 | TypesReader tr = new TypesReader(payload, off, len);
28 |
29 | int packet_type = tr.readByte();
30 |
31 | if (packet_type != Packets.SSH_MSG_SERVICE_REQUEST)
32 | throw new IOException("This is not a SSH_MSG_SERVICE_REQUEST! ("
33 | + packet_type + ")");
34 |
35 | serviceName = tr.readString();
36 |
37 | if (tr.remain() != 0)
38 | throw new IOException("Padding in SSH_MSG_SERVICE_REQUEST packet!");
39 | }
40 |
41 | public byte[] getPayload()
42 | {
43 | if (payload == null)
44 | {
45 | TypesWriter tw = new TypesWriter();
46 | tw.writeByte(Packets.SSH_MSG_SERVICE_REQUEST);
47 | tw.writeString(serviceName);
48 | payload = tw.getBytes();
49 | }
50 | return payload;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketSessionExecCommand.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.packets;
2 |
3 |
4 | /**
5 | * PacketSessionExecCommand.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 | public class PacketSessionExecCommand
11 | {
12 | byte[] payload;
13 |
14 | public int recipientChannelID;
15 | public boolean wantReply;
16 | public String command;
17 |
18 | public PacketSessionExecCommand(int recipientChannelID, boolean wantReply, String command)
19 | {
20 | this.recipientChannelID = recipientChannelID;
21 | this.wantReply = wantReply;
22 | this.command = command;
23 | }
24 |
25 | public byte[] getPayload()
26 | {
27 | if (payload == null)
28 | {
29 | TypesWriter tw = new TypesWriter();
30 | tw.writeByte(Packets.SSH_MSG_CHANNEL_REQUEST);
31 | tw.writeUINT32(recipientChannelID);
32 | tw.writeString("exec");
33 | tw.writeBoolean(wantReply);
34 | tw.writeString(command);
35 | payload = tw.getBytes();
36 | }
37 | return payload;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketSessionPtyRequest.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.packets;
2 |
3 |
4 | /**
5 | * PacketSessionPtyRequest.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 | public class PacketSessionPtyRequest
11 | {
12 | byte[] payload;
13 |
14 | public int recipientChannelID;
15 | public boolean wantReply;
16 | public String term;
17 | public int character_width;
18 | public int character_height;
19 | public int pixel_width;
20 | public int pixel_height;
21 | public byte[] terminal_modes;
22 |
23 | public PacketSessionPtyRequest(int recipientChannelID, boolean wantReply, String term,
24 | int character_width, int character_height, int pixel_width, int pixel_height,
25 | byte[] terminal_modes)
26 | {
27 | this.recipientChannelID = recipientChannelID;
28 | this.wantReply = wantReply;
29 | this.term = term;
30 | this.character_width = character_width;
31 | this.character_height = character_height;
32 | this.pixel_width = pixel_width;
33 | this.pixel_height = pixel_height;
34 | this.terminal_modes = terminal_modes;
35 | }
36 |
37 | public byte[] getPayload()
38 | {
39 | if (payload == null)
40 | {
41 | TypesWriter tw = new TypesWriter();
42 | tw.writeByte(Packets.SSH_MSG_CHANNEL_REQUEST);
43 | tw.writeUINT32(recipientChannelID);
44 | tw.writeString("pty-req");
45 | tw.writeBoolean(wantReply);
46 | tw.writeString(term);
47 | tw.writeUINT32(character_width);
48 | tw.writeUINT32(character_height);
49 | tw.writeUINT32(pixel_width);
50 | tw.writeUINT32(pixel_height);
51 | tw.writeString(terminal_modes, 0, terminal_modes.length);
52 |
53 | payload = tw.getBytes();
54 | }
55 | return payload;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketSessionStartShell.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.packets;
3 |
4 | /**
5 | * PacketSessionStartShell.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 | public class PacketSessionStartShell
11 | {
12 | byte[] payload;
13 |
14 | public int recipientChannelID;
15 | public boolean wantReply;
16 |
17 | public PacketSessionStartShell(int recipientChannelID, boolean wantReply)
18 | {
19 | this.recipientChannelID = recipientChannelID;
20 | this.wantReply = wantReply;
21 | }
22 |
23 | public byte[] getPayload()
24 | {
25 | if (payload == null)
26 | {
27 | TypesWriter tw = new TypesWriter();
28 | tw.writeByte(Packets.SSH_MSG_CHANNEL_REQUEST);
29 | tw.writeUINT32(recipientChannelID);
30 | tw.writeString("shell");
31 | tw.writeBoolean(wantReply);
32 | payload = tw.getBytes();
33 | }
34 | return payload;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketSessionSubsystemRequest.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.packets;
2 |
3 |
4 | /**
5 | * PacketSessionSubsystemRequest.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 | public class PacketSessionSubsystemRequest
11 | {
12 | byte[] payload;
13 |
14 | public int recipientChannelID;
15 | public boolean wantReply;
16 | public String subsystem;
17 |
18 | public PacketSessionSubsystemRequest(int recipientChannelID, boolean wantReply, String subsystem)
19 | {
20 | this.recipientChannelID = recipientChannelID;
21 | this.wantReply = wantReply;
22 | this.subsystem = subsystem;
23 | }
24 |
25 | public byte[] getPayload()
26 | {
27 | if (payload == null)
28 | {
29 | TypesWriter tw = new TypesWriter();
30 | tw.writeByte(Packets.SSH_MSG_CHANNEL_REQUEST);
31 | tw.writeUINT32(recipientChannelID);
32 | tw.writeString("subsystem");
33 | tw.writeBoolean(wantReply);
34 | tw.writeString(subsystem);
35 | payload = tw.getBytes();
36 | tw.getBytes(payload);
37 | }
38 | return payload;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketSessionX11Request.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.packets;
3 |
4 | /**
5 | * PacketSessionX11Request.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 | public class PacketSessionX11Request
11 | {
12 | byte[] payload;
13 |
14 | public int recipientChannelID;
15 | public boolean wantReply;
16 |
17 | public boolean singleConnection;
18 | String x11AuthenticationProtocol;
19 | String x11AuthenticationCookie;
20 | int x11ScreenNumber;
21 |
22 | public PacketSessionX11Request(int recipientChannelID, boolean wantReply, boolean singleConnection,
23 | String x11AuthenticationProtocol, String x11AuthenticationCookie, int x11ScreenNumber)
24 | {
25 | this.recipientChannelID = recipientChannelID;
26 | this.wantReply = wantReply;
27 |
28 | this.singleConnection = singleConnection;
29 | this.x11AuthenticationProtocol = x11AuthenticationProtocol;
30 | this.x11AuthenticationCookie = x11AuthenticationCookie;
31 | this.x11ScreenNumber = x11ScreenNumber;
32 | }
33 |
34 | public byte[] getPayload()
35 | {
36 | if (payload == null)
37 | {
38 | TypesWriter tw = new TypesWriter();
39 | tw.writeByte(Packets.SSH_MSG_CHANNEL_REQUEST);
40 | tw.writeUINT32(recipientChannelID);
41 | tw.writeString("x11-req");
42 | tw.writeBoolean(wantReply);
43 |
44 | tw.writeBoolean(singleConnection);
45 | tw.writeString(x11AuthenticationProtocol);
46 | tw.writeString(x11AuthenticationCookie);
47 | tw.writeUINT32(x11ScreenNumber);
48 |
49 | payload = tw.getBytes();
50 | }
51 | return payload;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketUserauthBanner.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.packets;
2 |
3 | import java.io.IOException;
4 |
5 | /**
6 | * PacketUserauthBanner.
7 | *
8 | * @author Christian Plattner
9 | * @version 2.50, 03/15/10
10 | */
11 | public class PacketUserauthBanner
12 | {
13 | byte[] payload;
14 |
15 | String message;
16 | String language;
17 |
18 | public PacketUserauthBanner(String message, String language)
19 | {
20 | this.message = message;
21 | this.language = language;
22 | }
23 |
24 | public String getBanner()
25 | {
26 | return message;
27 | }
28 |
29 | public PacketUserauthBanner(byte payload[], int off, int len) throws IOException
30 | {
31 | this.payload = new byte[len];
32 | System.arraycopy(payload, off, this.payload, 0, len);
33 |
34 | TypesReader tr = new TypesReader(payload, off, len);
35 |
36 | int packet_type = tr.readByte();
37 |
38 | if (packet_type != Packets.SSH_MSG_USERAUTH_BANNER)
39 | throw new IOException("This is not a SSH_MSG_USERAUTH_BANNER! (" + packet_type + ")");
40 |
41 | message = tr.readString("UTF-8");
42 | language = tr.readString();
43 |
44 | if (tr.remain() != 0)
45 | throw new IOException("Padding in SSH_MSG_USERAUTH_REQUEST packet!");
46 | }
47 |
48 | public byte[] getPayload()
49 | {
50 | if (payload == null)
51 | {
52 | TypesWriter tw = new TypesWriter();
53 | tw.writeByte(Packets.SSH_MSG_USERAUTH_BANNER);
54 | tw.writeString(message);
55 | tw.writeString(language);
56 | payload = tw.getBytes();
57 | }
58 | return payload;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketUserauthFailure.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.packets;
3 |
4 | import java.io.IOException;
5 |
6 | /**
7 | * PacketUserauthBanner.
8 | *
9 | * @author Christian Plattner
10 | * @version 2.50, 03/15/10
11 | */
12 | public class PacketUserauthFailure
13 | {
14 | byte[] payload;
15 |
16 | String[] authThatCanContinue;
17 | boolean partialSuccess;
18 |
19 | public PacketUserauthFailure(String[] authThatCanContinue, boolean partialSuccess)
20 | {
21 | this.authThatCanContinue = authThatCanContinue;
22 | this.partialSuccess = partialSuccess;
23 | }
24 |
25 | public PacketUserauthFailure(byte payload[], int off, int len) throws IOException
26 | {
27 | this.payload = new byte[len];
28 | System.arraycopy(payload, off, this.payload, 0, len);
29 |
30 | TypesReader tr = new TypesReader(payload, off, len);
31 |
32 | int packet_type = tr.readByte();
33 |
34 | if (packet_type != Packets.SSH_MSG_USERAUTH_FAILURE)
35 | throw new IOException("This is not a SSH_MSG_USERAUTH_FAILURE! (" + packet_type + ")");
36 |
37 | authThatCanContinue = tr.readNameList();
38 | partialSuccess = tr.readBoolean();
39 |
40 | if (tr.remain() != 0)
41 | throw new IOException("Padding in SSH_MSG_USERAUTH_FAILURE packet!");
42 | }
43 |
44 | public String[] getAuthThatCanContinue()
45 | {
46 | return authThatCanContinue;
47 | }
48 |
49 | public boolean isPartialSuccess()
50 | {
51 | return partialSuccess;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketUserauthInfoResponse.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.packets;
3 |
4 | /**
5 | * PacketUserauthInfoResponse.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 | public class PacketUserauthInfoResponse
11 | {
12 | byte[] payload;
13 |
14 | String[] responses;
15 |
16 | public PacketUserauthInfoResponse(String[] responses)
17 | {
18 | this.responses = responses;
19 | }
20 |
21 | public byte[] getPayload()
22 | {
23 | if (payload == null)
24 | {
25 | TypesWriter tw = new TypesWriter();
26 | tw.writeByte(Packets.SSH_MSG_USERAUTH_INFO_RESPONSE);
27 | tw.writeUINT32(responses.length);
28 | for (int i = 0; i < responses.length; i++)
29 | tw.writeString(responses[i]);
30 |
31 | payload = tw.getBytes();
32 | }
33 | return payload;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketUserauthRequestInteractive.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.packets;
3 |
4 | /**
5 | * PacketUserauthRequestInteractive.
6 | *
7 | * @author Christian Plattner
8 | * @version 2.50, 03/15/10
9 | */
10 | public class PacketUserauthRequestInteractive
11 | {
12 | byte[] payload;
13 |
14 | String userName;
15 | String serviceName;
16 | String[] submethods;
17 |
18 | public PacketUserauthRequestInteractive(String serviceName, String user, String[] submethods)
19 | {
20 | this.serviceName = serviceName;
21 | this.userName = user;
22 | this.submethods = submethods;
23 | }
24 |
25 | public byte[] getPayload()
26 | {
27 | if (payload == null)
28 | {
29 | TypesWriter tw = new TypesWriter();
30 | tw.writeByte(Packets.SSH_MSG_USERAUTH_REQUEST);
31 | tw.writeString(userName);
32 | tw.writeString(serviceName);
33 | tw.writeString("keyboard-interactive");
34 | tw.writeString(""); // draft-ietf-secsh-newmodes-04.txt says that
35 | // the language tag should be empty.
36 | tw.writeNameList(submethods);
37 |
38 | payload = tw.getBytes();
39 | }
40 | return payload;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/packets/PacketUserauthRequestNone.java:
--------------------------------------------------------------------------------
1 | package ch.ethz.ssh2.packets;
2 |
3 | import java.io.IOException;
4 |
5 | /**
6 | * PacketUserauthRequestPassword.
7 | *
8 | * @author Christian Plattner
9 | * @version 2.50, 03/15/10
10 | */
11 | public class PacketUserauthRequestNone
12 | {
13 | byte[] payload;
14 |
15 | String userName;
16 | String serviceName;
17 |
18 | public PacketUserauthRequestNone(String serviceName, String user)
19 | {
20 | this.serviceName = serviceName;
21 | this.userName = user;
22 | }
23 |
24 | public PacketUserauthRequestNone(byte payload[], int off, int len) throws IOException
25 | {
26 | this.payload = new byte[len];
27 | System.arraycopy(payload, off, this.payload, 0, len);
28 |
29 | TypesReader tr = new TypesReader(payload, off, len);
30 |
31 | int packet_type = tr.readByte();
32 |
33 | if (packet_type != Packets.SSH_MSG_USERAUTH_REQUEST)
34 | throw new IOException("This is not a SSH_MSG_USERAUTH_REQUEST! (" + packet_type + ")");
35 |
36 | userName = tr.readString();
37 | serviceName = tr.readString();
38 |
39 | String method = tr.readString();
40 |
41 | if (method.equals("none") == false)
42 | throw new IOException("This is not a SSH_MSG_USERAUTH_REQUEST with type none!");
43 |
44 | if (tr.remain() != 0)
45 | throw new IOException("Padding in SSH_MSG_USERAUTH_REQUEST packet!");
46 | }
47 |
48 | public byte[] getPayload()
49 | {
50 | if (payload == null)
51 | {
52 | TypesWriter tw = new TypesWriter();
53 | tw.writeByte(Packets.SSH_MSG_USERAUTH_REQUEST);
54 | tw.writeString(userName);
55 | tw.writeString(serviceName);
56 | tw.writeString("none");
57 | payload = tw.getBytes();
58 | }
59 | return payload;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/sftp/AttrTextHints.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.sftp;
3 |
4 | /**
5 | *
6 | * Values for the 'text-hint' field in the SFTP ATTRS data type.
7 | *
8 | * @author Christian Plattner
9 | * @version 2.50, 03/15/10
10 | *
11 | */
12 | public class AttrTextHints
13 | {
14 | /**
15 | * The server knows the file is a text file, and should be opened
16 | * using the SSH_FXF_ACCESS_TEXT_MODE flag.
17 | */
18 | public static final int SSH_FILEXFER_ATTR_KNOWN_TEXT = 0x00;
19 |
20 | /**
21 | * The server has applied a heuristic or other mechanism and
22 | * believes that the file should be opened with the
23 | * SSH_FXF_ACCESS_TEXT_MODE flag.
24 | */
25 | public static final int SSH_FILEXFER_ATTR_GUESSED_TEXT = 0x01;
26 |
27 | /**
28 | * The server knows the file has binary content.
29 | */
30 | public static final int SSH_FILEXFER_ATTR_KNOWN_BINARY = 0x02;
31 |
32 | /**
33 | * The server has applied a heuristic or other mechanism and
34 | * believes has binary content, and should not be opened with the
35 | * SSH_FXF_ACCESS_TEXT_MODE flag.
36 | */
37 | public static final int SSH_FILEXFER_ATTR_GUESSED_BINARY = 0x03;
38 | }
39 |
--------------------------------------------------------------------------------
/sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/sftp/AttribPermissions.java:
--------------------------------------------------------------------------------
1 |
2 | package ch.ethz.ssh2.sftp;
3 |
4 | /**
5 | *
6 | * Permissions for the 'permissions' field in the SFTP ATTRS data type.
7 | *
8 | * "The 'permissions' field contains a bit mask specifying file permissions. 9 | * These permissions correspond to the st_mode field of the stat structure 10 | * defined by POSIX [IEEE.1003-1.1996]." 11 | * 12 | * @author Christian Plattner 13 | * @version 2.50, 03/15/10 14 | * 15 | */ 16 | public class AttribPermissions 17 | { 18 | /* Octal values! */ 19 | 20 | public static final int S_IRUSR = 0400; 21 | public static final int S_IWUSR = 0200; 22 | public static final int S_IXUSR = 0100; 23 | public static final int S_IRGRP = 0040; 24 | public static final int S_IWGRP = 0020; 25 | public static final int S_IXGRP = 0010; 26 | public static final int S_IROTH = 0004; 27 | public static final int S_IWOTH = 0002; 28 | public static final int S_IXOTH = 0001; 29 | public static final int S_ISUID = 04000; 30 | public static final int S_ISGID = 02000; 31 | public static final int S_ISVTX = 01000; 32 | } 33 | -------------------------------------------------------------------------------- /sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/sftp/AttribTypes.java: -------------------------------------------------------------------------------- 1 | 2 | package ch.ethz.ssh2.sftp; 3 | 4 | /** 5 | * 6 | * Types for the 'type' field in the SFTP ATTRS data type. 7 | *
8 | * "On a POSIX system, these values would be derived from the mode field 9 | * of the stat structure. SPECIAL should be used for files that are of 10 | * a known type which cannot be expressed in the protocol. UNKNOWN 11 | * should be used if the type is not known." 12 | * 13 | * @author Christian Plattner 14 | * @version 2.50, 03/15/10 15 | * 16 | */ 17 | public class AttribTypes 18 | { 19 | public static final int SSH_FILEXFER_TYPE_REGULAR = 1; 20 | public static final int SSH_FILEXFER_TYPE_DIRECTORY = 2; 21 | public static final int SSH_FILEXFER_TYPE_SYMLINK = 3; 22 | public static final int SSH_FILEXFER_TYPE_SPECIAL = 4; 23 | public static final int SSH_FILEXFER_TYPE_UNKNOWN = 5; 24 | public static final int SSH_FILEXFER_TYPE_SOCKET = 6; 25 | public static final int SSH_FILEXFER_TYPE_CHAR_DEVICE = 7; 26 | public static final int SSH_FILEXFER_TYPE_BLOCK_DEVICE = 8; 27 | public static final int SSH_FILEXFER_TYPE_FIFO = 9; 28 | } 29 | -------------------------------------------------------------------------------- /sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/sftp/Packet.java: -------------------------------------------------------------------------------- 1 | 2 | package ch.ethz.ssh2.sftp; 3 | 4 | /** 5 | * 6 | * SFTP Paket Types 7 | * 8 | * @author Christian Plattner 9 | * @version 2.50, 03/15/10 10 | * 11 | */ 12 | public class Packet 13 | { 14 | public static final int SSH_FXP_INIT = 1; 15 | public static final int SSH_FXP_VERSION = 2; 16 | public static final int SSH_FXP_OPEN = 3; 17 | public static final int SSH_FXP_CLOSE = 4; 18 | public static final int SSH_FXP_READ = 5; 19 | public static final int SSH_FXP_WRITE = 6; 20 | public static final int SSH_FXP_LSTAT = 7; 21 | public static final int SSH_FXP_FSTAT = 8; 22 | public static final int SSH_FXP_SETSTAT = 9; 23 | public static final int SSH_FXP_FSETSTAT = 10; 24 | public static final int SSH_FXP_OPENDIR = 11; 25 | public static final int SSH_FXP_READDIR = 12; 26 | public static final int SSH_FXP_REMOVE = 13; 27 | public static final int SSH_FXP_MKDIR = 14; 28 | public static final int SSH_FXP_RMDIR = 15; 29 | public static final int SSH_FXP_REALPATH = 16; 30 | public static final int SSH_FXP_STAT = 17; 31 | public static final int SSH_FXP_RENAME = 18; 32 | public static final int SSH_FXP_READLINK = 19; 33 | public static final int SSH_FXP_SYMLINK = 20; 34 | 35 | public static final int SSH_FXP_STATUS = 101; 36 | public static final int SSH_FXP_HANDLE = 102; 37 | public static final int SSH_FXP_DATA = 103; 38 | public static final int SSH_FXP_NAME = 104; 39 | public static final int SSH_FXP_ATTRS = 105; 40 | 41 | public static final int SSH_FXP_EXTENDED = 200; 42 | public static final int SSH_FXP_EXTENDED_REPLY = 201; 43 | } 44 | -------------------------------------------------------------------------------- /sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/signature/DSAPrivateKey.java: -------------------------------------------------------------------------------- 1 | package ch.ethz.ssh2.signature; 2 | 3 | import java.math.BigInteger; 4 | 5 | /** 6 | * DSAPrivateKey. 7 | * 8 | * @author Christian Plattner 9 | * @version 2.50, 03/15/10 10 | */ 11 | public class DSAPrivateKey 12 | { 13 | private BigInteger p; 14 | private BigInteger q; 15 | private BigInteger g; 16 | private BigInteger x; 17 | private BigInteger y; 18 | 19 | public DSAPrivateKey(BigInteger p, BigInteger q, BigInteger g, 20 | BigInteger y, BigInteger x) 21 | { 22 | this.p = p; 23 | this.q = q; 24 | this.g = g; 25 | this.y = y; 26 | this.x = x; 27 | } 28 | 29 | public BigInteger getP() 30 | { 31 | return p; 32 | } 33 | 34 | public BigInteger getQ() 35 | { 36 | return q; 37 | } 38 | 39 | public BigInteger getG() 40 | { 41 | return g; 42 | } 43 | 44 | public BigInteger getY() 45 | { 46 | return y; 47 | } 48 | 49 | public BigInteger getX() 50 | { 51 | return x; 52 | } 53 | 54 | public DSAPublicKey getPublicKey() 55 | { 56 | return new DSAPublicKey(p, q, g, y); 57 | } 58 | } -------------------------------------------------------------------------------- /sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/signature/DSAPublicKey.java: -------------------------------------------------------------------------------- 1 | package ch.ethz.ssh2.signature; 2 | 3 | import java.math.BigInteger; 4 | 5 | /** 6 | * DSAPublicKey. 7 | * 8 | * @author Christian Plattner 9 | * @version 2.50, 03/15/10 10 | */ 11 | public class DSAPublicKey 12 | { 13 | private BigInteger p; 14 | private BigInteger q; 15 | private BigInteger g; 16 | private BigInteger y; 17 | 18 | public DSAPublicKey(BigInteger p, BigInteger q, BigInteger g, BigInteger y) 19 | { 20 | this.p = p; 21 | this.q = q; 22 | this.g = g; 23 | this.y = y; 24 | } 25 | 26 | public BigInteger getP() 27 | { 28 | return p; 29 | } 30 | 31 | public BigInteger getQ() 32 | { 33 | return q; 34 | } 35 | 36 | public BigInteger getG() 37 | { 38 | return g; 39 | } 40 | 41 | public BigInteger getY() 42 | { 43 | return y; 44 | } 45 | } -------------------------------------------------------------------------------- /sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/signature/DSASignature.java: -------------------------------------------------------------------------------- 1 | package ch.ethz.ssh2.signature; 2 | 3 | import java.math.BigInteger; 4 | 5 | /** 6 | * DSASignature. 7 | * 8 | * @author Christian Plattner 9 | * @version 2.50, 03/15/10 10 | */ 11 | public class DSASignature 12 | { 13 | private BigInteger r; 14 | private BigInteger s; 15 | 16 | public DSASignature(BigInteger r, BigInteger s) 17 | { 18 | this.r = r; 19 | this.s = s; 20 | } 21 | 22 | public BigInteger getR() 23 | { 24 | return r; 25 | } 26 | 27 | public BigInteger getS() 28 | { 29 | return s; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/signature/RSAPrivateKey.java: -------------------------------------------------------------------------------- 1 | package ch.ethz.ssh2.signature; 2 | 3 | import java.math.BigInteger; 4 | 5 | /** 6 | * RSAPrivateKey. 7 | * 8 | * @author Christian Plattner 9 | * @version 2.50, 03/15/10 10 | */ 11 | public class RSAPrivateKey 12 | { 13 | private BigInteger d; 14 | private BigInteger e; 15 | private BigInteger n; 16 | 17 | public RSAPrivateKey(BigInteger d, BigInteger e, BigInteger n) 18 | { 19 | this.d = d; 20 | this.e = e; 21 | this.n = n; 22 | } 23 | 24 | public BigInteger getD() 25 | { 26 | return d; 27 | } 28 | 29 | public BigInteger getE() 30 | { 31 | return e; 32 | } 33 | 34 | public BigInteger getN() 35 | { 36 | return n; 37 | } 38 | 39 | public RSAPublicKey getPublicKey() 40 | { 41 | return new RSAPublicKey(e, n); 42 | } 43 | } -------------------------------------------------------------------------------- /sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/signature/RSAPublicKey.java: -------------------------------------------------------------------------------- 1 | package ch.ethz.ssh2.signature; 2 | 3 | import java.math.BigInteger; 4 | 5 | /** 6 | * RSAPublicKey. 7 | * 8 | * @author Christian Plattner 9 | * @version 2.50, 03/15/10 10 | */ 11 | public class RSAPublicKey 12 | { 13 | BigInteger e; 14 | BigInteger n; 15 | 16 | public RSAPublicKey(BigInteger e, BigInteger n) 17 | { 18 | this.e = e; 19 | this.n = n; 20 | } 21 | 22 | public BigInteger getE() 23 | { 24 | return e; 25 | } 26 | 27 | public BigInteger getN() 28 | { 29 | return n; 30 | } 31 | } -------------------------------------------------------------------------------- /sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/signature/RSASignature.java: -------------------------------------------------------------------------------- 1 | 2 | package ch.ethz.ssh2.signature; 3 | 4 | import java.math.BigInteger; 5 | 6 | 7 | /** 8 | * RSASignature. 9 | * 10 | * @author Christian Plattner 11 | * @version 2.50, 03/15/10 12 | */ 13 | 14 | public class RSASignature 15 | { 16 | BigInteger s; 17 | 18 | public BigInteger getS() 19 | { 20 | return s; 21 | } 22 | 23 | public RSASignature(BigInteger s) 24 | { 25 | this.s = s; 26 | } 27 | } -------------------------------------------------------------------------------- /sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/transport/KexParameters.java: -------------------------------------------------------------------------------- 1 | package ch.ethz.ssh2.transport; 2 | 3 | /** 4 | * KexParameters. 5 | * 6 | * @author Christian Plattner 7 | * @version 2.50, 03/15/10 8 | */ 9 | public class KexParameters 10 | { 11 | public byte[] cookie; 12 | public String[] kex_algorithms; 13 | public String[] server_host_key_algorithms; 14 | public String[] encryption_algorithms_client_to_server; 15 | public String[] encryption_algorithms_server_to_client; 16 | public String[] mac_algorithms_client_to_server; 17 | public String[] mac_algorithms_server_to_client; 18 | public String[] compression_algorithms_client_to_server; 19 | public String[] compression_algorithms_server_to_client; 20 | public String[] languages_client_to_server; 21 | public String[] languages_server_to_client; 22 | public boolean first_kex_packet_follows; 23 | public int reserved_field1; 24 | } 25 | -------------------------------------------------------------------------------- /sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/transport/KexState.java: -------------------------------------------------------------------------------- 1 | package ch.ethz.ssh2.transport; 2 | 3 | 4 | import ch.ethz.ssh2.DHGexParameters; 5 | import ch.ethz.ssh2.crypto.dh.DhExchange; 6 | import ch.ethz.ssh2.crypto.dh.DhGroupExchange; 7 | import java.math.BigInteger; 8 | import ch.ethz.ssh2.packets.PacketKexInit; 9 | 10 | /** 11 | * KexState. 12 | * 13 | * @author Christian Plattner 14 | * @version 2.50, 03/15/10 15 | */ 16 | public class KexState 17 | { 18 | public PacketKexInit localKEX; 19 | public PacketKexInit remoteKEX; 20 | public NegotiatedParameters np; 21 | public int state = 0; 22 | 23 | public BigInteger K; 24 | public byte[] H; 25 | 26 | public byte[] hostkey; 27 | 28 | public DhExchange dhx; 29 | public DhGroupExchange dhgx; 30 | public DHGexParameters dhgexParameters; 31 | } 32 | -------------------------------------------------------------------------------- /sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/transport/MessageHandler.java: -------------------------------------------------------------------------------- 1 | package ch.ethz.ssh2.transport; 2 | 3 | import java.io.IOException; 4 | 5 | /** 6 | * MessageHandler. 7 | * 8 | * @author Christian Plattner 9 | * @version 2.50, 03/15/10 10 | */ 11 | public interface MessageHandler 12 | { 13 | public void handleMessage(byte[] msg, int msglen) throws IOException; 14 | } 15 | -------------------------------------------------------------------------------- /sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/transport/NegotiateException.java: -------------------------------------------------------------------------------- 1 | package ch.ethz.ssh2.transport; 2 | 3 | /** 4 | * NegotiateException. 5 | * 6 | * @author Christian Plattner 7 | * @version 2.50, 03/15/10 8 | */ 9 | public class NegotiateException extends Exception 10 | { 11 | private static final long serialVersionUID = 3689910669428143157L; 12 | } 13 | -------------------------------------------------------------------------------- /sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/transport/NegotiatedParameters.java: -------------------------------------------------------------------------------- 1 | package ch.ethz.ssh2.transport; 2 | 3 | /** 4 | * NegotiatedParameters. 5 | * 6 | * @author Christian Plattner 7 | * @version 2.50, 03/15/10 8 | */ 9 | public class NegotiatedParameters 10 | { 11 | public boolean guessOK; 12 | public String kex_algo; 13 | public String server_host_key_algo; 14 | public String enc_algo_client_to_server; 15 | public String enc_algo_server_to_client; 16 | public String mac_algo_client_to_server; 17 | public String mac_algo_server_to_client; 18 | public String comp_algo_client_to_server; 19 | public String comp_algo_server_to_client; 20 | public String lang_client_to_server; 21 | public String lang_server_to_client; 22 | } 23 | -------------------------------------------------------------------------------- /sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/util/StringEncoder.java: -------------------------------------------------------------------------------- 1 | 2 | package ch.ethz.ssh2.util; 3 | 4 | import java.io.UnsupportedEncodingException; 5 | 6 | /** 7 | * 8 | * @author Christian Plattner 9 | * @version 2.50, 03/15/10 10 | */ 11 | public class StringEncoder 12 | { 13 | public static byte[] GetBytes(String data) 14 | { 15 | try 16 | { 17 | return data.getBytes("ISO8859_1"); 18 | } 19 | catch (UnsupportedEncodingException e) 20 | { 21 | byte[] bytes = new byte[data.length()]; 22 | 23 | for (int i = 0; i < data.length(); i++) 24 | { 25 | char c = data.charAt(i); 26 | if (c > 127) 27 | bytes[i] = 0x3F; // ? 28 | else 29 | bytes[i] = (byte) c; 30 | } 31 | 32 | return bytes; 33 | } 34 | } 35 | 36 | public static String GetString(byte[] data) 37 | { 38 | return GetString(data, 0, data.length); 39 | } 40 | 41 | public static String GetString(byte[] data, int off, int len) 42 | { 43 | try 44 | { 45 | return new String(data, off, len, "ISO8859_1"); 46 | } 47 | catch (UnsupportedEncodingException e) 48 | { 49 | char[] chars = new char[len]; 50 | 51 | for (int i = 0; i < len; i++) 52 | { 53 | char c = (char) data[off + i]; 54 | if (c > 127) 55 | c = '?'; 56 | chars[i] = c; 57 | } 58 | 59 | return new String(chars); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /sshfrommatlab_13b/ganymed-ssh2-build250/src/ch/ethz/ssh2/util/Tokenizer.java: -------------------------------------------------------------------------------- 1 | 2 | package ch.ethz.ssh2.util; 3 | 4 | /** 5 | * Tokenizer. Why? Because StringTokenizer is not available in J2ME. 6 | * 7 | * @author Christian Plattner 8 | * @version 2.50, 03/15/10 9 | */ 10 | public class Tokenizer 11 | { 12 | /** 13 | * Exists because StringTokenizer is not available in J2ME. 14 | * Returns an array with at least 1 entry. 15 | * 16 | * @param source must be non-null 17 | * @param delimiter 18 | * @return an array of Strings 19 | */ 20 | public static String[] parseTokens(String source, char delimiter) 21 | { 22 | int numtoken = 1; 23 | 24 | for (int i = 0; i < source.length(); i++) 25 | { 26 | if (source.charAt(i) == delimiter) 27 | numtoken++; 28 | } 29 | 30 | String list[] = new String[numtoken]; 31 | int nextfield = 0; 32 | 33 | for (int i = 0; i < numtoken; i++) 34 | { 35 | if (nextfield >= source.length()) 36 | { 37 | list[i] = ""; 38 | } 39 | else 40 | { 41 | int idx = source.indexOf(delimiter, nextfield); 42 | if (idx == -1) 43 | idx = source.length(); 44 | list[i] = source.substring(nextfield, idx); 45 | nextfield = idx + 1; 46 | } 47 | } 48 | 49 | return list; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sshfrommatlab_13b/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011, David S. Freedman 2 | Copyright (c) 2009, Kostas Katrinis 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in 13 | the documentation and/or other materials provided with the distribution 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /sshfrommatlab_13b/sshfrommatlabclose.m: -------------------------------------------------------------------------------- 1 | function channel = sshfrommatlabclose(channel) 2 | %SSHFROMMATLABCLOSE disconnects Matlab from a remote machine 3 | % 4 | % CHANNEL = SSHFROMMATLABCLOSE(CHANNEL) 5 | % 6 | % where CHANNEL is the Java ChannelShell object to disconnect 7 | % 8 | % See also SSHFROMMATLAB, SSHFROMMATLABINSTALL, SSHFROMMATLABISSUE 9 | % 10 | % (c) 2008 British Oceanographic Data Centre 11 | % Adam Leadbetter (alead@bodc.ac.uk) 12 | % 2010 Boston University - ECE 13 | % David Scott Freedman (dfreedma@bu.edu) 14 | % Version 1.3 15 | % 16 | if(nargin ~= 1) 17 | error('Error: SSHFROMMATLABCLOSE requires one input argument...'); 18 | end 19 | % 20 | % Disconnect the Java object using the java method if it is of the correct 21 | % class, if not quit with an error 22 | % 23 | if(isa(channel,'ch.ethz.ssh2.Connection')) 24 | channel.close(); 25 | else 26 | error(['Error: SSHFROMMATLABCLOSE input argument CHANNEL is'... 27 | ' not a Java Connection object...']); 28 | end -------------------------------------------------------------------------------- /sshfrommatlab_13b/sshfrommatlabissue_dontwait.m: -------------------------------------------------------------------------------- 1 | function [channel] = sshfrommatlabissue_dontwait(channel,command) 2 | %SSHFROMMATLAB_DONTWAIT issues commands to a remote computer from within Matlab 3 | % but doesn't wait for the response. Can be useful for issueing commands 4 | % quickly 5 | % 6 | % [CONN] = SSHFROMMATLAB_DONTWAIT(CONN,COMMAND) 7 | % 8 | % Inputs: 9 | % CHANNEL is a Java ChannelShell object 10 | % COMMAND 11 | % 12 | % Outputs: 13 | % CHANNEL is the returned Java ChannelShell object 14 | % 15 | % See also SSHFROMMATLABCLOSE, SSHFROMMATLABINSTALL, SSHFROMMATLABISSUE 16 | % 17 | % (c) 2008 British Oceanographic Data Centre 18 | % Adam Leadbetter (alead@bodc.ac.uk) 19 | % 2010 Boston University - ECE 20 | % David Scott Freedman (dfreedma@bu.edu) 21 | % Version 1.3 22 | % 23 | 24 | 25 | import java.io.BufferedReader; 26 | import java.io.IOException; 27 | import java.io.InputStream; 28 | import java.io.InputStreamReader; 29 | import ch.ethz.ssh2.Connection; 30 | import ch.ethz.ssh2.Session; 31 | import ch.ethz.ssh2.StreamGobbler; 32 | 33 | % 34 | % Invocation checking 35 | % 36 | if(nargin ~= 2) 37 | error('Error: SSHFROMMATLAB_DONTWAIT requires two input arguments...'); 38 | end 39 | if(~isa(channel,'ch.ethz.ssh2.Connection')) 40 | error(['Error: SSHFROMMATLAB_DONTWAIT input argument CHANNEL '... 41 | 'is not a Java Connection object...']); 42 | end 43 | if(~ischar(command)) 44 | error(['Error: SSHFROMMATLAB_DONTWAIT input argument COMMAND '... 45 | 'is not a string...']); 46 | end 47 | % 48 | % Send the commands 49 | % 50 | channel2 = channel.openSession(); 51 | channel2.execCommand(command); 52 | 53 | channel2.close(); 54 | 55 | clear channel2; 56 | clear stdout; 57 | clear br; -------------------------------------------------------------------------------- /template_curve_match.m: -------------------------------------------------------------------------------- 1 | function residual_var = template_curve_match(shift,xvals,data,template) 2 | residual = data(xvals)-polyval(template,xvals+round(shift)); 3 | residual_var=var(residual); 4 | end -------------------------------------------------------------------------------- /tuckermcclure-matlab-plot-big-00aea55/.gitignore: -------------------------------------------------------------------------------- 1 | # MATLAB Auto-saves 2 | .asv 3 | 4 | # File indicating that this directory should be kept on the path 5 | matlab_path 6 | -------------------------------------------------------------------------------- /tuckermcclure-matlab-plot-big-00aea55/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Tucker 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /tuckermcclure-matlab-plot-big-00aea55/README.md: -------------------------------------------------------------------------------- 1 | # matlab-plot-big 2 | 3 | Makes large MATLAB line plots much faster. 4 | 5 | This simple tool intercepts data going into a plot and reduces it to the smallest possible set that looks identical given the number of pixels available on the screen. It then updates the data as a user zooms or pans. This is useful when a user must plot a very large amount of data and explore it visually. 6 | 7 | This works with MATLAB's built-in line plot functions, allowing the functionality of those to be preserved. 8 | 9 | Instead of: 10 | 11 | ``` 12 | plot(t, x); 13 | ``` 14 | 15 | One could use: 16 | 17 | ``` 18 | reduce_plot(t, x); 19 | ``` 20 | 21 | Most plot options, such as multiple series and line properties, can be passed in too, such that 'reduce_plot' is largely a drop-in replacement for 'plot'. 22 | 23 | ``` 24 | h = reduce_plot(t, x(1, :), 'b:', t, x(2, :), t, x(3, :), 'r--*'); 25 | ``` 26 | 27 | This function works on plots where the "x" data is always increasing, which is the most common, such as for time series. 28 | 29 |  30 | 31 | For more information, see: 32 | 33 | ``` 34 | >> help LinePlotReducer 35 | ``` 36 | 37 | or 38 | 39 | ``` 40 | >> help reduce_plot 41 | ``` 42 | 43 | or 44 | 45 | ``` 46 | >> help LinePlotExplorer 47 | ``` 48 | 49 | File Exchange page: http://www.mathworks.com/matlabcentral/fileexchange/40790 50 | 51 | Thanks for downloading. 52 | 53 | Tucker McClure 54 | 55 | Copyright 2013-2015, The MathWorks, Inc. and Tucker McClure 56 | -------------------------------------------------------------------------------- /tuckermcclure-matlab-plot-big-00aea55/get_axes_width.m: -------------------------------------------------------------------------------- 1 | function pixels = get_axes_width(h) 2 | 3 | % pixels = get_axes_width(h) 4 | % 5 | % Returns the width of the axes object, h, in pixels. 6 | % 7 | % --- Change Log --- 8 | % 9 | % 2014-06-04: Avoids changing axes units where possible. 10 | % Changes copyright 2014 Tucker McClure. 11 | % 12 | % 2013-03-15: Original. Copyright 2013, The MathWorks, Inc. 13 | % 14 | % --- 15 | % 16 | % Copyright 2014, The MathWorks, Inc. and Tucker McClure 17 | 18 | % Record the current axes units setting. 19 | axes_units = get(h, 'Units'); 20 | 21 | % We should change the units only if they're not already set to pixels. 22 | change_units = ~strcmp(axes_units, 'pixels'); 23 | 24 | % Change axes units to pixels. 25 | if change_units 26 | set(h, 'Units', 'pixels'); % This triggers other callbacks. 27 | end 28 | 29 | % Get axes width in pixels. 30 | axes_position = get(h, 'Position'); 31 | pixels = round(axes_position(3)); 32 | 33 | % Return the units. 34 | if change_units 35 | set(h, 'Units', axes_units); % This triggers other callbacks. 36 | end 37 | 38 | end 39 | -------------------------------------------------------------------------------- /tuckermcclure-matlab-plot-big-00aea55/reduce_plot.m: -------------------------------------------------------------------------------- 1 | function h = reduce_plot(varargin) 2 | 3 | % h = reduce_plot(varargin) 4 | % 5 | % This is a light wrapper function for LinePlotReducer. It accepts exactly 6 | % the same arguments, but returns plot handles instead of a LinePlotReducer 7 | % object. See 'help LinePlotReducer'. 8 | % 9 | % Tucker McClure 10 | % Copyright 2013, The MathWorks, Inc. 11 | 12 | lpr = LinePlotReducer(varargin{:}); 13 | h = lpr.h_plot; 14 | 15 | end 16 | -------------------------------------------------------------------------------- /tuckermcclure-matlab-plot-big-00aea55/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vncntprvst/tools/d4c6e382d9de4dfe6e26ba2a34b5f170635f0c7b/tuckermcclure-matlab-plot-big-00aea55/screenshot.png --------------------------------------------------------------------------------