Publish tab is missing
56 views (last 30 days)
Show older comments
I don't seem to have a Publish tab in Matlab. How do I find or install it? TIA
2 Comments
Answers (1)
Sean de Wolski
on 18 Jul 2013
Edited: Sean de Wolski
on 18 Jul 2013
Run the following at the command line:
edit sfdslkjflksjf
(Accept the prompt)
Does the publish tab show up? If it does, the reason it wasn't showing up was likely because the file in the editor did not have the extension *.m. The publish tab doesn't show up for *.txt, *.c, *.cpp etc. just *.m
If it doesn't show up with that, something has corrupter your preferences directory. Save the following and run it, it will clear this directory and will fix the issue:
function moveprefdir(restart)
%MOVEPREFDIR - Rename preferences directory and optionally restart MATLAB
%
% MOVEPREFDIR renames the current prefdir to [current_name date_time]
% and restarts MATLAB if you wish. Restarting MATLAB is required
% to regenerate preferences.
%
%Usage: MOVEPREFDIR
% MOVEPREFDIR(restart)
%
%Inputs:
% -restart: optional, logical scalar:
% Do you want to restart MATLAB automatically?
% {default: prompt user}
%
%Outputs:
% -No outputs but gives you a message box with details
%
%See also: prefdir movefile
%
%
%Sean de Wolski - Copyright, The MathWorks, Inc 12/10/2012
%
%Error Checking and defaults:
assert(any(nargin==[0 1]),'One or Zero inputs expected');
if nargin == 1;
assert(isscalar(restart) && islogical(restart),'If supplied, restart is supposed to be logical scalar');
prompt = false;
else
prompt = true;
end
%Move the preferences directory:
old_prefdir = prefdir;
new_prefdir = [prefdir, datestr(now,'ddmm_hhMM')];
[status, msg] = movefile(old_prefdir,new_prefdir);
%Display results:
if status
h = msgbox(sprintf('Old PREFDIR: %s renamed to %s',old_prefdir,new_prefdir),'Move Successful','modal');
waitfor(h);
else
errordlg(msg,'Move Failed','modal');
return;
end
%Prompt for restarting:
if prompt
choice = questdlg(sprintf('Restarting MATLAB is required to regenerate Prefences\nDo you want to restart MATLAB now?'),'Restart?','Yes!','No','Yes!');
restart = strcmp(choice,'Yes!');
end
%Restarting:
if restart
system('matlab &'); %Open new ML session
exit; %Leave this one
end
end
0 Comments
See Also
Categories
Find more on Startup and Shutdown 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!