Not enough input arguments

1 次查看(过去 30 天)
I am trying to run this code but I keep getting the "Not enough Input arguments" on the line with "loglog(grainsize, stress(i,:),'color',cc(i,:))", which does not make sense to me because grainsize and stress are both 1x6 double. I have tried it with the color linspec removed and it gives the same error.
Help is appreciated.
CTemp=650; %<-- INPUT temperature in Celcius
KTemp=CTemp+273; %conversion to Kelvin
Bdepth=(CTemp/30)*1000; %<-- INPUT burial depth in meters, related to temperature
R=8.314; %gas constant
%Matrix values
strainrate=[1e-5 1e-7 1e-9 1e-11 1e-13 1e-15]; %range of strain rate values
grainsize=[0.01 0.1 1 10 100 1000]; %range of grain size in microns
% l = length(strainrate);
% stress = zeros(l,l);
cc=hsv(12); %generates a set of colors
%Diffusion Creep - Walker et al., 1990
for i=1:length(strainrate)
for j=1:length(grainsize)
A=10^4.93;
m=-1.87;
Q=190000;
n=1.7;
temp(i,j)=(strainrate(i)/(A*(grainsize(j).^m)*(exp(-Q/(R*KTemp)))))^(1/n);
stress(i,j) =[temp(i,j)];
end
loglog(grainsize, stress(i,:),'color',cc(i,:))
hold on
end
The full error I get is:
Not enough input arguments.
Error in isgraphics (line 3)
out = ishandle(h) && strcmpi(get(h,'type'),type);
Error in cla (line 45)
elseif isscalar(ax) && isgraphics(ax)
Error in newplot>ObserveAxesNextPlot (line 156)
cla(ax, 'reset', hsave);
Error in newplot (line 99)
ax = ObserveAxesNextPlot(ax, hsave);
Error in matlab.graphics.internal.newplotwrapper (line 11)
axReturn = newplot(varargin{:});
Error in CalciteDefMecMAP (line 45)
loglog(grainsize, stress(i,:),'color',cc(i,:))

采纳的回答

Matt J
Matt J 2022-8-9
It must be something in your environment. Running the code here in the forum produces no errors. I would suggest clearing the workspace.
CTemp=650; %<-- INPUT temperature in Celcius
KTemp=CTemp+273; %conversion to Kelvin
Bdepth=(CTemp/30)*1000; %<-- INPUT burial depth in meters, related to temperature
R=8.314; %gas constant
%Matrix values
strainrate=[1e-5 1e-7 1e-9 1e-11 1e-13 1e-15]; %range of strain rate values
grainsize=[0.01 0.1 1 10 100 1000]; %range of grain size in microns
% l = length(strainrate);
% stress = zeros(l,l);
cc=hsv(12); %generates a set of colors
%Diffusion Creep - Walker et al., 1990
for i=1:length(strainrate)
for j=1:length(grainsize)
A=10^4.93;
m=-1.87;
Q=190000;
n=1.7;
temp(i,j)=(strainrate(i)/(A*(grainsize(j).^m)*(exp(-Q/(R*KTemp)))))^(1/n);
stress(i,j) =[temp(i,j)];
end
loglog(grainsize, stress(i,:),'color',cc(i,:))
hold on
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Stress and Strain 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by