Rank: 494 based on 165 downloads (last 30 days) and 7 files submitted
photo

Mark Mikofski

E-mail
Company/University
SunPower
Lat/Long
37.91043090820312, -122.359260559082

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Mark View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
14 May 2013 Screenshot JGit4MATLAB JGit4MATLAB is a wrapper for JGit in MATLAB. It is meant to be used from the MATLAB command window. Author: Mark Mikofski git, scm, dvcs, version control, source control manage..., distributed version c... 22 1
03 May 2013 Screenshot Spline2D or Piecewise Continuous 2D Polynomials Fit a 2D function with piecewise continuous polynomials Author: Mark Mikofski data exploration, interpolation, mathematics, modeling, optimization 33 0
18 Apr 2013 Screenshot polyVal2D and polyFit2D Evaluate 2D polynomials using Horner's method. Fit 2D polynomials to data using backslash operator. Author: Mark Mikofski mathematics, optimization, data exploration, interpolation, modeling 45 0
26 Mar 2012 Screenshot IAPWS_IF97 functional form with no slip Water and steam properties and derivatives based on the IAPWS IF97. Functional form. No slip. Author: Mark Mikofski control design, simulation, chemistry, modeling, hydrodynamics, thermodynamics 14 5
  • 4.66667
4.7 | 3 ratings
01 Mar 2012 myDynamicClass Create a set of objects from a text file. Author: Mark Mikofski data import, class, oop, objects 3 1
Comments and Ratings by Mark View all
Updated File Comments Rating
15 May 2013 JGit4MATLAB JGit4MATLAB is a wrapper for JGit in MATLAB. It is meant to be used from the MATLAB command window. Author: Mark Mikofski

FYI:
All commands that deal with remotes and that require authentication, EG: CLONE, FETCH, PULL, PUSH, will *only* work
* with SSH
* with *no* passphrase
* with keys in the openSSH format
* with keys and known hosts in $HOME\.ssh

Obviously remotes that do not require authentication will work fine. EG: public, read-only and local repositories.

SSH is very easy to set up.
1. Download puttygen (Intel x86) from this site:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Disregard the "Intel x86" business, it doesn't matter what processor you have or whether your os is 64-bit or 32-bit. Puttygen is a very mature well establish application that is used by many other applications, for example all of the TortoiseXXX scm clients use Putty, Plink and Pageant
This is the actual download here: (click to download then click to install)
http://the.earth.li/~sgtatham/putty/latest/x86/puttygen.exe
2. create a folder called .ssh in your %USERPROFILE%. On Windows 7 this is
C:\Users\<your account name>
and on xp it is
C:\Documents and Settings\<your account name>
You can do this in matlab.
>> mkdir(fullfile(getenv('userprofile'), '.ssh'))
3. create a key using puttygen, this is fairly self explantory, and kind of fun, but do *not* set a passphrase; leave those fields blank!
4. using puttygen, find the conversion menu tab and export the key in the openSSH format to the .ssh folder you created earlier.
5. now copy and paste your public key to your remote repositories (Github, Bitbucket, etc.) as needed. Jsch, which is the ssh client that JGit uses should now work out of the box.

Unfortunately using https isn't possible with JGit4MATLAB. Sorry. but hopefully you'll love the excitement of using ssh key pairs!

19 Feb 2013 JSONlab: a toolbox to encode/decode JSON files in MATLAB/Octave JSONlab is an open-source implementation of a JSON encoder and a decoder/parser for MATLAB/Octave. Author: Qianqian Fang

@Jan, I've been using a JSON.jar [1] I made from the java-json source [2] and it works perfectly. I don't know how native java speed compares with native MATLAB though.

[1] http://dl.dropbox.com/u/19049582/JSON.jar
[2] http://json.org/java/

30 May 2012 polyfitZero Fit polynomial to data, forcing y-intercept to zero. Author: Mark Mikofski

John, Sorry for my slow response. You can accomplish this the same way I zeroed out the last coefficient.

E.g. to force the 1st order coefficient to zero do the following:

% ...
x = x(:);
y = y(:);

% since you want might want to include the constant term,
% change "z" to be a matrix of ones, and make it one column wider
% to include the 0th-order term

% z = zeros(dim,degree); % comment out this line which doesn't include constant
z = ones(dim,degree+1); % add this line which now includes 0th-order term

for n = 1:degree
z(:,n) = x.^(degree-n+1);
end

% you don't have to calculate the constant term,
% because it will be a column of ones (i.e. x^0 = 1)
% now remove any columns that you don't want to fit
% e.g. we want to force the 1st order coefficient to zero
orderOfZeroCoeffs = 1; % a vector of terms to omit from regression, e.g. [1,0],
% you could make "orderOfZeroCoeffs" an input to the function

% now, remove the terms whose coeffs you want to zero
orderOfNonZeroCoeffs= ~ismember(degree:-1:0, orderOfZeroCoeffs);
z = z(:,orderOfNonZeroCoeffs); % replace z with the columns removed
% there are a 1000 other ways to write this code!

% comment out the following lines
% because now it's more complicated
% pZero = z\y;
% pZero = [pZero;0]';

% instead create a vector of zeros
% any terms not calculated are already set to zero
pZero = zeros(1,degree+1);
% substitute the coefficients directly into "pZero" by index assignment
pZero(orderOfNonZeroCoeffs) = z\y;

% ...

Try that out. I'm curious what you're using this for. Also check out the other polyfit0 (fex272) function that Jennifer Sanders found above. You can modify it in exactly the same way I show here, but you will also have to modify the other output parameters.

25 Apr 2012 JSONlab: a toolbox to encode/decode JSON files in MATLAB/Octave JSONlab is an open-source implementation of a JSON encoder and a decoder/parser for MATLAB/Octave. Author: Qianqian Fang

FYI: for those interested in using Java org.json in MATLAB

Demo:
https://gist.github.com/2492355
git clone git://gist.github.com/2492355.git orgJSONdemo

JSON in Java (org.json):
http://www.json.org/java/index.html

Using Java Collections in Matlab:
http://undocumentedmatlab.com/blog/using-java-collections-in-matlab/

Storing MATLAB structs in Java Objects

Java SE 6 (1.6) API:
http://docs.oracle.com/javase/6/docs/api/

Java HashMap
http://docs.oracle.com/javase/6/docs/api/java/util/HashMap.html

Java ArrayList
http://docs.oracle.com/javase/6/docs/api/java/util/ArrayList.html

Passing Data to a Java Method:
http://www.mathworks.com/help/techdoc/matlab_external/f6425.html

Handling Data Returned from a Java Method:
http://www.mathworks.com/help/techdoc/matlab_external/f6671.html

Bringing Java Classes and Methods into MATLAB Workspace: Simplifying Java Class Names:
http://www.mathworks.com/help/techdoc/matlab_external/f4863.html#f46341

Working with Java Arrays:
http://www.mathworks.com/help/techdoc/matlab_external/f15351.html

Concatenating Java Objects:
http://www.mathworks.com/help/techdoc/matlab_external/f4873.html#f48488

javaArray:
http://www.mathworks.com/help/techdoc/ref/javaarray.html

24 Apr 2012 JSONlab: a toolbox to encode/decode JSON files in MATLAB/Octave JSONlab is an open-source implementation of a JSON encoder and a decoder/parser for MATLAB/Octave. Author: Qianqian Fang

Thank you Q. Fang for this excellent program. As an alternative anyone could just use the org.json files directly from java. they are here:
https://github.com/douglascrockford/JSON-java
and directions are here:
http://www.json.org/java/index.html
You need to compile them or just export them to a jar file which requires jdk. I have compiled it already for you here:
http://dl.dropbox.com/u/19049582/JSON.jar
Before you can use the org.json library you have to add to your java class path (either dynamic or static) by following the directions here:
http://www.mathworks.com/help/techdoc/matlab_external/f4863.html
For example: javaaddpath('full-path\JSON.jar') will add the jar file to your dynamic path.
Then you can use java which is native to MATLAB to use the org.json library.
For example:
jsonObj = org.json.JSONObject('{myKey:myVal}')

Comments and Ratings on Mark's Files View all
Updated File Comment by Comments Rating
15 May 2013 JGit4MATLAB JGit4MATLAB is a wrapper for JGit in MATLAB. It is meant to be used from the MATLAB command window. Author: Mark Mikofski Mikofski, Mark

FYI:
All commands that deal with remotes and that require authentication, EG: CLONE, FETCH, PULL, PUSH, will *only* work
* with SSH
* with *no* passphrase
* with keys in the openSSH format
* with keys and known hosts in $HOME\.ssh

Obviously remotes that do not require authentication will work fine. EG: public, read-only and local repositories.

SSH is very easy to set up.
1. Download puttygen (Intel x86) from this site:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Disregard the "Intel x86" business, it doesn't matter what processor you have or whether your os is 64-bit or 32-bit. Puttygen is a very mature well establish application that is used by many other applications, for example all of the TortoiseXXX scm clients use Putty, Plink and Pageant
This is the actual download here: (click to download then click to install)
http://the.earth.li/~sgtatham/putty/latest/x86/puttygen.exe
2. create a folder called .ssh in your %USERPROFILE%. On Windows 7 this is
C:\Users\<your account name>
and on xp it is
C:\Documents and Settings\<your account name>
You can do this in matlab.
>> mkdir(fullfile(getenv('userprofile'), '.ssh'))
3. create a key using puttygen, this is fairly self explantory, and kind of fun, but do *not* set a passphrase; leave those fields blank!
4. using puttygen, find the conversion menu tab and export the key in the openSSH format to the .ssh folder you created earlier.
5. now copy and paste your public key to your remote repositories (Github, Bitbucket, etc.) as needed. Jsch, which is the ssh client that JGit uses should now work out of the box.

Unfortunately using https isn't possible with JGit4MATLAB. Sorry. but hopefully you'll love the excitement of using ssh key pairs!

23 Feb 2013 polyfitZero Fit polynomial to data, forcing y-intercept to zero. Author: Mark Mikofski giga

13 Dec 2012 IAPWS_IF97 functional form with no slip Water and steam properties and derivatives based on the IAPWS IF97. Functional form. No slip. Author: Mark Mikofski Clark, Thomas

Nice vectorisation, thank you for this Mark.

30 May 2012 polyfitZero Fit polynomial to data, forcing y-intercept to zero. Author: Mark Mikofski Mikofski, Mark

John, Sorry for my slow response. You can accomplish this the same way I zeroed out the last coefficient.

E.g. to force the 1st order coefficient to zero do the following:

% ...
x = x(:);
y = y(:);

% since you want might want to include the constant term,
% change "z" to be a matrix of ones, and make it one column wider
% to include the 0th-order term

% z = zeros(dim,degree); % comment out this line which doesn't include constant
z = ones(dim,degree+1); % add this line which now includes 0th-order term

for n = 1:degree
z(:,n) = x.^(degree-n+1);
end

% you don't have to calculate the constant term,
% because it will be a column of ones (i.e. x^0 = 1)
% now remove any columns that you don't want to fit
% e.g. we want to force the 1st order coefficient to zero
orderOfZeroCoeffs = 1; % a vector of terms to omit from regression, e.g. [1,0],
% you could make "orderOfZeroCoeffs" an input to the function

% now, remove the terms whose coeffs you want to zero
orderOfNonZeroCoeffs= ~ismember(degree:-1:0, orderOfZeroCoeffs);
z = z(:,orderOfNonZeroCoeffs); % replace z with the columns removed
% there are a 1000 other ways to write this code!

% comment out the following lines
% because now it's more complicated
% pZero = z\y;
% pZero = [pZero;0]';

% instead create a vector of zeros
% any terms not calculated are already set to zero
pZero = zeros(1,degree+1);
% substitute the coefficients directly into "pZero" by index assignment
pZero(orderOfNonZeroCoeffs) = z\y;

% ...

Try that out. I'm curious what you're using this for. Also check out the other polyfit0 (fex272) function that Jennifer Sanders found above. You can modify it in exactly the same way I show here, but you will also have to modify the other output parameters.

24 May 2012 polyfitZero Fit polynomial to data, forcing y-intercept to zero. Author: Mark Mikofski John

I wonder if you could modify the routine so that higher powers could also be forced to be zero. For example, the current routine set the constant coefficient to zero. But, can the 1st order coefficient also be forced to be zero. And so on...

Top Tags Applied by Mark
modeling, data exploration, interpolation, mathematics, class
Files Tagged by Mark View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
14 May 2013 Screenshot JGit4MATLAB JGit4MATLAB is a wrapper for JGit in MATLAB. It is meant to be used from the MATLAB command window. Author: Mark Mikofski git, scm, dvcs, version control, source control manage..., distributed version c... 22 1
03 May 2013 Screenshot Spline2D or Piecewise Continuous 2D Polynomials Fit a 2D function with piecewise continuous polynomials Author: Mark Mikofski data exploration, interpolation, mathematics, modeling, optimization 33 0
18 Apr 2013 Screenshot polyVal2D and polyFit2D Evaluate 2D polynomials using Horner's method. Fit 2D polynomials to data using backslash operator. Author: Mark Mikofski mathematics, optimization, data exploration, interpolation, modeling 45 0
26 Mar 2012 Screenshot IAPWS_IF97 functional form with no slip Water and steam properties and derivatives based on the IAPWS IF97. Functional form. No slip. Author: Mark Mikofski control design, simulation, chemistry, modeling, hydrodynamics, thermodynamics 14 5
  • 4.66667
4.7 | 3 ratings
01 Mar 2012 myDynamicClass Create a set of objects from a text file. Author: Mark Mikofski data import, class, oop, objects 3 1

Contact us