Publish tab is missing
19 ビュー (過去 30 日間)
古いコメントを表示
I don't seem to have a Publish tab in Matlab. How do I find or install it? TIA
2 件のコメント
回答 (1 件)
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
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!