Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matlab 2011a unsupported now... #13

Closed
lrq3000 opened this issue Nov 21, 2016 · 4 comments
Closed

Matlab 2011a unsupported now... #13

lrq3000 opened this issue Nov 21, 2016 · 4 comments

Comments

@lrq3000
Copy link

lrq3000 commented Nov 21, 2016

Hey there,

This is a great application, thank you for making and sharing it!

I used to use it with Matlab 2011a, but now it's uncompatible because of the following error:

Undefined function or method 'gobjects' for input arguments of type 'double'.

Error in ==> <a href="matlab: opentoline('C:\matlab_tools\bspmview\supportfiles\pgrid.m',65,0)">pgrid at 65</a>
phandle     = gobjects(npanel, 1);

Error in ==> <a href="matlab: opentoline('C:\matlab_tools\bspmview\bspmview.m',577,0)">bspmview>put_upperpane at 577</a>
    [phandle, pidx] = pgrid(nrow, 1, ...

Error in ==> <a href="matlab: opentoline('C:\matlab_tools\bspmview\bspmview.m',535,0)">bspmview>put_figure at 535</a>
    put_upperpane;

Error in ==> <a href="matlab: opentoline('C:\matlab_tools\bspmview\bspmview.m',139,0)">bspmview at 139</a>
    S = put_figure(ol, ul); shg;

Indeed, gobjects was introduced in MATLAB 2013.

The last version of bspmview I used which was compatible with MATLAB 2011 was bspmview-829fd7d. Maybe you should make a release with this commit for people with an old MATLAB version (like me)?

PS: I'm not asking to maintain the compatibility with the old MATLAB, but just to release a commit of bspmview when it was still compatible, I know my collegues (who are all using the same version of MATLAB as me) would find it useful...

@spunt
Copy link
Owner

spunt commented Nov 21, 2016

Oops - thanks for the heads up about this. Let me look into the error to see if there's an easy solution for the current version. Otherwise, I'll put up a release with that old commit.

@spunt
Copy link
Owner

spunt commented Nov 21, 2016

Looks like the call to gobjects that is causing the error is unnecessary. In the file pgrid.m which is located in the supportfiles/ subdirectory, comment out the line where gobjects is called (should be around line 66). The result should look like this:

npanel          = size(hpos, 1);
% phandle     = gobjects(npanel, 1);

Save the file then try bspmview again. Since I don't have an older version of MATLAB to test this on, would you mind trying this out and letting me know how it works? I want to make sure it works before creating a new release. Let me know, thanks.

@lrq3000
Copy link
Author

lrq3000 commented Nov 22, 2016

Ok I commented out the gobjects line, then I got another error:

??? Error using ==> vertcat
CAT arguments dimensions are not consistent.

Error in ==> bspmview>put_upperpane at 599
        uihandles = [uihandles; chandle];

Error in ==> bspmview>put_figure at 535
    put_upperpane;

Error in ==> bspmview at 139
    S = put_figure(ol, ul); shg;

And another similar error at line 664. Both were fixed by transposing chandle. And it works now!

To summarize my changes:

  • supportfiles/pgrid.m comment line line 66: % phandle = gobjects(npanel, 1);
  • bspmview.m lines 599 & 664: uihandles = [uihandles; chandle'];

Thanks a lot!

spunt added a commit that referenced this issue Nov 22, 2016
…e issue #13, thanks to lrq3000 for catching and help with troubleshooting)
@spunt
Copy link
Owner

spunt commented Nov 22, 2016

Thanks for looking into this! Latest commit (and release) should now work pre MATLAB 2014. Just a heads up, instead of transposing chandle in the main function, I wound up just reverting the relevant line of pgrid.m to preallocate the phandle array using the old method, i.e.,

phandle = zeros(npanel, 1);

@spunt spunt closed this as completed Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants