GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - m053m716/Matlab-Defaults: My preferred defaults as a package with functions named after Matlab built-ins.

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
Contents.m
Contents.m
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
axes.m
axes.m
 
 
bar.m
bar.m
 
 
figure.m
figure.m
 
 
histogram.m
histogram.m
 
 
legend.m
legend.m
 
 
line.m
line.m
 
 
now.m
now.m
 
 
patch.m
patch.m
 
 
savefig.m
savefig.m
 
 

Repository files navigation

MATLAB (R2020b) Defaults

View Matlab-Defaults on File Exchange

This repository contains my (@m053m716) preferred defaults as a package with functions named after Matlab built-ins.

Installation

Simply clone this repository into whatever Project folder that you would like to use the defaults for. Because of the GitHub naming convention, which does not allow the remote repository name to start with + (which is the default character preceding folders that are Matlab "packages"), you will need to make sure that the contents of this folder are cloned so that they are contained within a folder called +default (or whatever you would like the package name to be called on your local machine). Then, any functions contained within the package are effectively within the +default "name-space" which means that they can be called as:

>> help default
>> fig = default.figure(); % Creates Untitled Matlab figure with standard preferences
>> fig = default.figure('MyFigure'); % Creates figure named 'MyFigure'
>> fig = default.figure('MyFigure','Position',[0.1 0.1 0.8 0.8]); % Change the "Position" <'Name',value> setting

Example

My recommended configuration (Windows 10 machine running Matlab R2020b; this could change with subsequent versions or for UNIX operating systems) is to clone this repository into a non-project folder where you plan to contain other custom packages. A convenient location is the default userpath:

>> userpath
ans = 
	'C:\Users\Max\Documents\MATLAB'

My C: drive is a small SSD, but I have a larger HDD for storing data and other things. So, I can change my userpath, which is updated each time a Matlab session is started up as a given User (see: userpath documentation for details).

>> mkdir('D:\MATLAB\Tools');    % Location I want to store packages etc.
>> userpath('D:\MATLAB\Tools'); % Now, that will be the userpath that loads each time

Now, if I put this repository as a package named +default in that folder (so: 'D:\MATLAB\Tools\+default'), each time I start a new MATLAB session by default my local code and command calls will "see" the contents of this repository. Note: this is (as of 2020-12-11) still a pretty small repo. If it gets bigger, this may not be desirable, as that will potentially cause MATLAB to run more slowly in general.

About

My preferred defaults as a package with functions named after Matlab built-ins.

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.