【Help】Error using contour (line 81), Not enough input arguments.

1 view (last 30 days)
Hello! I have trouble in using contour function to plot, it always returns "Error using contour (line 81), Not enough input arguments."
I am using Matlab2014a, it returns "Error using contour (line 81), Not enough input arguments." when I use Run (F5), and it goes through but displys no picture when I use (ctrl+shift+enter).
Hoping for help, Thanks!!
The program is as follows,
x=Data(1,:);
y=Data(2,:);
f=Data(5,:);
xx=reshape(x,301,43);
yy=reshape(y,301,43);
ff=reshape(f,301,43);
v=[0,0];
figure1 = figure('PaperSize',[20.98404194812 29.67743169791]);
axes1 = axes('Parent',figure1,...
'PlotBoxAspectRatio',[1 2.27272727272727 90.9090909090909],...
'Layer','top',...
'XMinorTick','on',...
'YTick',[0 0.1 0.2],...
'YMinorTick','on',...
'TickDir','out',...
'FontSize',20,...
'FontName','Times New Roman',...
'DataAspectRatio',[1 1 1]);
axis(axes1,[-0.021,0.021,0,0.2]);
xlabel(axes1,'{\it{x}}/m','FontSize',25,'FontName','Times New Roman');
ylabel(axes1,'{\it{y}}/m','FontSize',25,'FontName','Times New Roman');
axis equal;
set(gcf,'color',[1 1 1],'Position',[0,0,232,680]);
set(gca,'position',[0.15 0.11 0.95 0.86]);
box(axes1,'on');
hold(axes1,'all');
[C,hh]=contour(xx,yy,ff,v,'r','LineWidth',2);
  3 Comments
Ren Zetian
Ren Zetian on 5 May 2015
Thanks! I changed the original file name "contour-plot.m" and it works well now!
Walter Roberson
Walter Roberson on 5 May 2015
Do not use dashes in the name of .m files. The first character must be a letter A through Z or a through z, and the characters after that must be letters or the digits 0 through 9, or the underscore character.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 5 May 2015
Converting my comment into an answer so it can be marked as solved:
The difficulty was that the file the user had stored in was itself named contour.m which was conflicting with the contour routine.

More Answers (0)

Categories

Find more on Contour Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!