Script f1.m
Download Script f1.m
%----------------------------------------------------------
%Function:f1.m - script:s1.m
%UNCOMMENT ONLY ONE OF THE THREE WORKING VERSIONS
%----------------------------------------------------------
%VERSION 1:the function name f1 appears on the right
function z=f1(x1)
xq1=x1.^2
z=18-xq1/8 %z must be on the left part of the assignment
%----------------------------------------------------------
%VERSION 2: f1 is on the left and becomes output argument
% function f1=a(x2)
% xq2=x2.^2
% f1=18-xq2/8 %f1 must be on the left part of the line
%----------------------------------------------------------
%VERSION 3: the function name f1 is completely absent
% function c=b(x3)
% xq3=x3.^2
% c=18-xq3/8 %a must be on the left part of the line
%----------------------------------------------------------
Back