Hi i’m new to MatLab. Why I can’t get the values from matrix x in function MyInput() to calculate in another func and the command window says ‘Not enough input arguments. ‘?
function Calculate(x)
MyInput();
y = zeros(1,6);
for j=2:6
y(1,j) = x(1,j)^j;
j=j+1;
end
end
function x = MyInput()
x = zeros(1,6);
x(1,1) = 2;
for i=2:6
x(1,i)=x(1,i-1)+1;
i=i+1;
end
endfunction Calculate(x)
MyInput();
y = zeros(1,6);
for j=2:6
y(1,j) = x(1,j)^j;
j=j+1;
end
end
function x = MyInput()
x = zeros(1,6);
x(1,1) = 2;
for i=2:6
x(1,i)=x(1,i-1)+1;
i=i+1;
end
end function Calculate(x)
MyInput();
y = zeros(1,6);
for j=2:6
y(1,j) = x(1,j)^j;
j=j+1;
end
end
function x = MyInput()
x = zeros(1,6);
x(1,1) = 2;
for i=2:6
x(1,i)=x(1,i-1)+1;
i=i+1;
end
end #returnvalue, #function MATLAB Answers — New Questions