

clc 
clear all

a = struct('b', 0, 'c', 'test')

b = a.b

c = a.c


pause
clc
clear all


Ball = struct('mass',{},'position',{},'velocity',{},'radius',{})

pause

BALL(1) = struct('mass',10,...
'position',[0 0 100],...
'velocity',[0 0 0],...
'radius', 3)

pause
clc
clear all

stocks=struct('name',{'GOOG','AAPL'},'full',...
{'Google Inc.','Apple Inc'},...
'value',{522.35,278.64},'quant',200)

stocks(2).full

pause 
clear all
clc

data.x = linspace(0,2*pi);
data.y = sin(data.x);

data
data.x
data.y

pause
clc
clear all



patient(1).name = 'John Doe';

patient(1).billing = 127.00;

patient(1).test = [79, 75, 73; 180, 178, 177.5; 220, 210, 205];

patient

pause

patient(2).name = 'Ann Lane';

patient(2).billing = 28.50;

patient(2).test = [68, 70, 68; 118, 118, 119; 172, 170, 169];

patient

pause

patient(3).name = 'New Name';

patient(3)

pause

amount_due = patient(1).billing

pause

bar(patient(1).test)

title(['Test Results for ', patient(1).name])

clc
clear all
pause

people(1).name = 'john';
people(1).job = 'manager';
people(1).id = 123456;

people(2).name = 'mary';
people(2).job = 'owner';
people(2).id = 567890;

people(3).name = 'justin';
people(3).job = 'singer';
people(3).id = 246801;

people(1).name
people(2).name
people(3).name
people(:).name
a = [people(:).name]

clc
clear all
pause

ball.mass = 10;

ball.position = [0, 0, 100];

ball.velocity = [0, 0, 0]

ball.position = ball.position + [0 10 0]

ball.radius = 3

ball(2:3,1)= ball

ball(1).mass = 1.0;

ball(2).mass = 5.0;

ball(3).mass = 10.0;

ball.mass

m = [ball.mass]

totalMass = sum([ball.mass])

pause
clc
clear all

NameData.First = 'John';

NameData.MI = 'J';

NameData.Last = 'Doe';



StudentData.Name = NameData;



StudentData.Status = 'Brilliant';

StudentData.HW = 10;

StudentData.Exam = linspace(100,100,3);



StudentData

StudentData.Name

StudentData.Exam

pause

StudentData.Exam(3) = 0;

StudentData.Exam

StudentData.Name.First = 'Jane';

StudentData.Name

pause
clc

num_students = 5;

for i=1:num_students

    ClassData(i) = StudentData;

end

ClassData

ClassData(2)


pause
clc


message = pass_or_fail(ClassData(2));

message


pause
clc
clear all


s(1).n(2).a = 2*ones(3);

s(1).n(2).b = 2*eye(4);

s(1).n(2).c = 2*magic(5);

s(2).n(1).a = '1a';

s(2).n(2).a = '2a';

s(2).n(1).b = '1b';

s(2).n(2).b = '2b';

s(2).n(1).c = '1c';

s(2).n(2).c = '2c';

s1n2 = s(1).n(2).c

s2n2 = s(2).n(1)


pause
clc
clear all


S = load('clown.mat')

image(S.X)

colormap(S.map)

pause

upperLeft = S.X(1:50,1:80);

image(upperLeft);

