Matrix as a result of function

Perhaps a very simple question, but I am already looking for a watch on the Internet for an answer, but I cannot find it.

I created a function below. In another m file I want to use the matrix "actual_location". However, it is not possible to use a separate matrix cell (i.e. the actual location (3.45) or actual_location (1.2)). When I try to use a single cell, I get the following error:??? Error using ==> Actual_Location Too many input arguments.

Can someone tell me what I need to change so that I can read the individual cells of the matrix?

function [actual_location] = Actual_Location(~);  
actual_location=zeros(11,161);
for b=1:11  
   for t=1:161  
       actual_location(b,t) = (59/50)*(t-2-(b-1)*12)+1;   
       if actual_location(b,t) < 1  
           actual_location(b,t) =1;  
       end       
   end  
   actual_location(1,1)  
end
+5
source share
2 answers

, m , Actual_Location, actual_location. , , , . , , , Matlab :

actual_location = Actual_Location(arguments);

, . , actual_location , , :

output = Actual_Location(arguments);

, , actual_location (1,1) 1,1 , , , 2 .

+1

, -, , Actual_Location ... .

function [actual_location] = Actual_Location()
  actual_location=zeros(11,161); 
  for b=1:11
    for t=1:161
      actual_location(b,t) = (59/50)*(t-2-(b-1)*12)+1;
      if actual_location(b,t) < 1
        actual_location(b,t) = 1;
      end
    end
    actual_location(1,1)
  end
+1

All Articles