Great way to plot graphs in different tabs. Highly recommended.
Note: There is a small bug with graphs from different tabs being plotted on top of each other. This can be fixed using uipanel for each graph (instead of uicontainer). See comments below from @eff and @Brett 22nd Aug 2013.
I am using Matlab R2009a (Version 7.8) with MS Word 2010.
In general an excellent library for controlling MS Word, the only problem is the lack of examples and documentation.
The example you posted on the 15th June 2012 worked great except for the command "saveAs(w,file);" which returns the following error:
??? Error using ==> saveas at 59
Error in ==> dir_test3 at 100
Please can you also post an example that uses the scalePicture and insertTable functions? In particular, what is the format of the data passed into the insertTable function?
Have you read "readme.txt" file in "patch" folder, where p-file you've mentioned is located?
It mostly explains why they are there.
It looks like these files are fixed versions of core matlab functions, so developers won't release source code for them. Just hope that those issues would be removed some time.
It's easy to use, however, I've been facing same problem while trying to compile this GUI into standalone application.
When attempting to compile some of your code, warnings are given relative to the P-files missing their associated M-Files.
Here is one example :
Warning: Requirements cannot analyze P-code unless the user provides a corresponding M-code along with the P-code in the
same folder. The dependencies of D:\Codes\MATLAB\GUILayout-v1p14\Patch\getpixelposition.p may not be included in the
completion because its corresponding M-code cannot be found by REQUIREMENTS.
I was wondering if there's any workaround, or if you can release the m-code. Since the main reason to write a gui is to distribute it through standalone projects. Thanks for helping in advance.
There is a small "bug" that makes this package incompatible with the Matlab "Application compiler" app for redistributing compiled stand alone applications.
A work around is the following:
The problem lies with the image locations being hard-linked to the location of the package from the use of "fileparts". I replaced these lines with a test for "isdeployed", for example lines 424/5 of uiextras.TabPanel (iLoadIcon function) to:
this_dir = fileparts( mfilename( 'fullpath' ) );
icon_dir = fullfile( this_dir, 'Resources' );
this_dir = '.';
icon_dir = '.';
I then simply include the resource files in the list of additional files in the app.
Thank you very much for this tool!
Some comments from my side:
1. Function scaleAllImages, line 163-164:
There is no need in specifying both ScaleHeight and ScaleWidth. Indeed, the aspect ratio should be hold, so I replaced these lines with
2. If somebody wants to insert Matlab figs into the MS word documents as is (as they are presented at the screen), the following code should be helpful, I think:
%additional arguments specified to avoid opening the figure that is already opened
fig = openfig(file,'reuse','invisible');
%to set the figure size in the word document to be the same as on the screen
%copy figure to clipboard as windows EMF
I've placed this code to the insertPicture function instead of the line 413:
actxWord.Application.Selection.InlineShapes.AddPicture( file, link, savewithdoc );