I am using Matlab R2017a. In earlier versions, there used to be an option, while in the debug mode, to switch the workspaces amongst calling functions in order to examine the values of the variables in the respective workspaces. I can not find the control in this current version Matlab R2017a. How does one switch?
The function call stack dropdown is on the editor tab while your program is stopped in the debugger:
You can also use dbstack, dbup, and dbdown to list the stacks and navigate through them via the command window.
Related
I am currently working with Simulink and out of the sudden, I am unable to change the Model Configuration Parameters.
Whether I try to open the window via RightClick->Model Configuration Parameters or via Ctrl+E, in both cases, a blank white window opens.
This problem persists after a reboot and opening/closing MATLAB. Furthermore, it is the case for any model (whether old, new, untouched, example...) on my computer. Yesterday I searched for 45min for possible solutions but could not find any.
Is there some graphics cache or can you think of another way, how I could get the dialog back? A photo is attached:
Screenshot: Configuration Parameters window stays blank
Thanks a lot in advance!
This problem happens in Academic version on Simulink. I have not seen it in Original software.
A solution for your problem can be :
1) clear cache of Simulink by typeing the following command in command window :
rehash toolboxcache
2) reset menu and toolbar of Simulink by the following command :
sl_refresh_customizations
Then close MATLAB by exit command.
I am running a GUI in MATLAB. I want whenever my GUI gets opened MATLAB command window should be minimized?
I have tried with WindowAPI but it is not working. Please give some suggestions on how to do this.
You can do this using Matlab's Java support, thereby manipulating the (undocumented) Java objects that make up the Matlab IDE. As far as I know, the Command Window is always embedded in the main Matlab Desktop Window, so here's the code to minimize that.
Get a reference to the Java object that implements the Matlab Desktop:
desktop = com.mathworks.mde.desk.MLDesktop.getInstance();
Get a reference to the window (Java Frame) that contains the Desktop:
mf = desktop.getMainFrame();
Minimize it:
mf.setMinimized(true);
This approach works across platforms.
See http://undocumentedmatlab.com/ for more information on the undocumented internals of Matlab.
Is there a way to create a GUI which starts as a maximized windows?
I've tried to add set(gcf,'Units','normalized','Position',[0,0,1,1]); at the end of my gui's mygui_OpeningFcn() function but the GUI is not maximized properly (see printscreen).
Setting the GUI properties at GUIDE to Units-'normalized' and Position-[0,0,1,1] didn't help either.
I've also tried to use the Matlab File Exchange maximize function by adding maximize(handle.figure1); at the end of my gui's mygui_OpeningFcn() but it doesn't work either (same visual result - a GUI which is not entirely maximized).
Is there a way to make the Matlab GUI appear as a maximized figure when I launch it?
Why am I getting this strange visual behavior of the GUI?
If you are on a Windows machine, I suggest you use the WindowAPI submission from FEX. It directly calls Windows API functions (using a MEX file), thus allowing far more advanced control of figures than just minimize and maximize:
hFig = figure('Menubar','none');
WindowAPI(hFig,'Maximize')
I can use auto word completion at the MATLAB command prompt by pressing tab, but I can not do that while using the Editor for an m file. Is there any way to use tab completion in the Editor?
According to this MathWorks blog post, tab completion works in the Editor as it does in the Command Window for MATLAB R2010a, but you may have to turn it on in the Keyboard Preferences menu.
For older MATLAB versions, tab completion in the Editor only works for function names and variables that have already been created in the workspace. So, if you are writing a script with a variable foobar, and that variable hasn't yet been created in the workspace (i.e. Command Window), then foobar won't show up when using tab completion in the Editor. This was the case when I tested it in MATLAB 7.8.0 (R2009a).
When you are writing a code press key "TAB", see:
Tab completion works for function names that are on Matlab's path. It also works for variable names, if the variable exists in the workspace. Thus, while you code, it may be a good idea to evaluate commands as you write. This allows you to immediately check for errors, and it makes variables available for auto-completion.
I will need to use multiple workspaces for a recent project. Each workspace might consist of 10 or more projects.
When I'm switching between various applications and different eclipse instances(for the multiple workspaces), I want to be able to distinguish a given workspace easily without having to spend 5 seconds to know from the open file, etc.
What facilities are available to quickly know which workspace I'm in ?
Use the -showlocation command line argument when starting Eclipse. This shows the current workspace name in the window's title. You can also put the argument in the eclipse.ini file.
You can also add your own window title in:
eclipse preferences > workspace > workspace name (shown in window title)
Explained here: http://eclipse.dzone.com/articles/show-workspace-location-title
-showlocation is great, but it only changes the text at the end of the title bar, so it's often not visible in the taskbar.
If you want to change the beginning of the title bar, which shows the current Perspective, you can use Window -> Save Perspective As... and the new title will be visible in the Taskbar.
You could use also the OS for this to setup different workspaces, with diff, background or so. Where you have in each workspace a Eclipse running, with a diff workspace.
You can also create different working sets in the same workspace. The you only need one eclipse and switch between working sets in 1 sec depending on the mouse speed :)