Q:

Given a vector of structures defined by the following statements:

0

kit(2).sub.id = 123;

kit(2).sub.wt = 4.4;

kit(2).sub.code = 'a';

kit(2).name = 'xyz';

kit(2).lens = [4 7];

kit(1).name = 'rst';

kit(1).lens = 5:6;

kit(1).sub.id = 33;

kit(1).sub.wt = 11.11;

kit(1).sub.code = 'q';

Which of the following expressions are valid? If the expression is valid, 

give its value. If it is not valid, explain why.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

>> kit(1).sub

ans = 

 id: 33

 wt: 11.1100

 code: 'q'

>> kit(2).lens(1)

ans =

 4

>> kit(1).code

Reference to non-existent field 'code'.

>> kit(2).sub.id == kit(1).sub.id

ans =

 0

>> strfind(kit(1).name, 's')

ans =

 2

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now