Publish tab is missing

37 次查看(过去 30 天)
Beth
Beth 2013-7-17
I don't seem to have a Publish tab in Matlab. How do I find or install it? TIA
  2 个评论
Jan
Jan 2013-7-17
Please mention the version of your Matlab.

请先登录,再进行评论。

回答(1 个)

Sean de Wolski
Sean de Wolski 2013-7-18
编辑:Sean de Wolski 2013-7-18
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

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by