Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Matlab by xixor ( 17 years ago )
function [output_1, output_2] = some_function(A)
% save this function as some_function.m

% I will do some random operations now
A = 2*A;
B = 3*A - A;
C = 4*A - B; 
output_1 = my_helper(C);
output_2 = my_helper(B);


%% ==================
function z = my_helper(x)

z = zeros(size(x));  % pre-allocate z to be the size of x

% a random loop
for i=1:length(x)
    z(i) = 2*x(i);
end;

% note that you do not need

 

Revise this Paste

Children: 12495
Your Name: Code Language: