Program demonstrating For loop and Functions > Matlab

Program demonstrating For loop and Functions > Matlab

Soft Computing



exp1.m
clc
clear all
a=mysq(675);
a
b=fnew(10)



mysq.m
function x=mysq(a)
x=a*a+2*a;


fnew.m
function x=fnew(a)
sum=0
for i=1:a
sum=sum+i;
end
x=sum

Comments

Popular posts from this blog

Intermediate Code Generation > C Program