not enough input arguments
3 views (last 30 days)
Show older comments
hiii, i m new to matlab and i am trying to execute a function named tempmatrix.m ,, but it is giving error not enough input arguments. the input argument values are coming from the output of other functions which are giving exactly desired results...please help me
error in 11th line...
function [ temp ] = tempmatrix( x, y, z, new, north, south, top, bottom, right, radiation )
T0=27;
temp=T0*ones(101*11,101);
row=101;
col=101;
surface=11;
for cz=1:surface % for the surfaces
for cy=1:row % for the rows
index1=(cz-1)*row*col+(cy-1)*col+1;
index2=(cz-1)*row*col+cy*col;
new1=new(index1:index2,:); *here it is giving error*
top1=top(index1:index2,1);
bottom1=bottom(index1:index2,1);
north1=north(index1:index2,1);
south1=south(index1:index2,1);
right1=right(index1:index2,1);
radiation1=zeros(length(index1:index2),1);
for cx=1:col % for the columns
if cz==1
radiation1(1:col,1)=radiation(((cy-1)*col+1):(cy*col),1).*(temp(cy,cx)^4) ;
radiation1(cx,1)=radiation((cy-1)*col+cx,1)*(temp(cy,cx)^4) ;
end
if cz>1
top1(cx,1)=top1(cx,1)*temp((cz-2)*row+cy,cx);
end
if cz<surface
bottom1(cx,1)=bottom1(cx,1)*temp(cz*row+cy,cx);
end
if cy>1
north1(cx,1)=north1(cx,1)*temp((cz-1)*row+cy-1,cx);
end
if cy<row
south1(cx,1)=south1(cx,1)*temp((cz-1)*row+cy+1,cx);
end
end
if cz==1
right1(1:col,1)=right1(1:col,1)+radiation1(1:col,1);
end
right1(1:col,1)=right1(1:col,1)+north1(1:col,1)+south1(1:col,1)+top1(1:col,1)+bottom1(1:col,1);
for i=1:col-1;
new1(i,3)=new1(i,3)/new1(i,2);
right1(i,1)=right1(i,1)/new1(i,2);
new1(i,2)=1;
new1(i+1,2)=new1(i+1,2)-new1(i+1,1)*new1(i,3);
right1(i+1,1)=right1(i+1,1)-right1(i,1)*new1(i+1,1);
new1(i+1,1)=0;
end
right1(col,1)=right1(col,1)/new1(col,2);
new1(col,2)=1;
for i=col:-1:2
right1(i-1,1)=right1(i-1,1)-right1(i,1)*new1(i-1,3);
new1(i-1,3)=0;
end
temp((cz-1)*row+cy,:)=right1(1:col,:);
end
end
mesh(x,y,temp(1:101,1:101))
end
0 Comments
Answers (1)
Walter Roberson
on 7 May 2014
You say that
the input argument values are coming from the output of other functions
but the error you see is consistent with you not having passed any arguments to the function. Please show how you are invoking the function.
See Also
Categories
Find more on Sparse Matrices 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!