Download older versions of a file in File Exchange?

1 view (last 30 days)
Is it possible to download older versions of a file in File Exchange? If yes, how? If no, do you know why?
The case is simple, when you refer to a file in file exchange, you refer to its API at the time of referral, but the author can change the API and your reference will be invalid. It doesn't seem like a good practice to keep a copy of the file and refer to that instead of the page on FEX.

Accepted Answer

Cedric
Cedric on 8 Aug 2013
Edited: Cedric on 8 Aug 2013
It is not good practice, but if you are stuck with no time to update function calls in 100's of m-files because of a small change in the interface (.e.g different order in input/output parameters, or use of an inputParser with named parameters in the new version), you can build a wrapper for the new version of this function which has the interface of the old one.
Example: if you were using the outstanding, but outdated function doSomething
function [z, msg] = doSomething(x, y)
% Some code.
end
and its author decides suddenly to use an inputParser and reverse output parameters (shame on him)..
function [msg, z] = doSomething(varargin)
% Some code.
end
so calls to the new version should be done as follows:
[m, z] = doSomething('yValue', y, 'xValue', x) ;
(you know, named parameters, as e.g. in calls to PLOT with optional args.)
Well, a temporary solution for not having to update all calls immediately would be to rename the new version into doSomething_NEW:
function [msg, z] = doSomething_NEW(varargin)
% Some code.
end
and to write the following wrapper, which has the same interface as the old version:
function [z, msg] = doSomething(x, y)
% Wrapper for DOSOMETHING_NEW
% This is a **temporary** solution because I don't have
% time to update calls everywhere now.
[msg, z] = doSomething_NEW('yValue', y, 'xValue', x) ;
end
But.. be sure that if people could down-vote solutions involving bad practice, this solution would hit -8000 ;-)
  5 Comments

Sign in to comment.

More Answers (1)

Jan
Jan on 8 Aug 2013
You can simply contact the author and ask for an old version.
Usually authors have good reasons for changing the input and output arguments. Then keeping a variety of different version will confuse many users.

Categories

Find more on Downloads in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!