W1Q1: Logically address an array % Option 1 - My solution v=A(:)==1; % Option 2 - Also good v=A==1; v(:); % Option 3 - Some people used LOGICAL in weird ways, sometimes correctly, sometimes not, but never necessary! Here is one such example, which is correct v=A(logical(A))==1; % Option 4 - Some people used RESHAPE in weird ways, sometimes correctly, sometimes not, but never necessary! Here are two such examples, which is correct v=reshape(A==1,prod(size(A)),1); v=reshape(A,[m*m,1])==1; v=reshape(A==1,[size(A,1)*size(A,2),1]); % Option 5 - Here's an example of using ALL unnecessarily that still works since it's working in the second dimension of a one-dimensional array, so effecticely it is the identity operation v=all(A(:)==1,2) % Option 6 - Here's an example of something that simply doesn't affect the solution, using TRUE without reassigning the result to a variable v=A(:)==1; true(v'); W1Q2: Address a structure implicitly % Option 1 - Stick in a number and a string l=2; q='ID'; % Option 2 - Overdone, using a logical l=strcmp('Bob',{students.Name}); q='ID'; % Option 3 - Correct, while sinning against the "don't change the line below" l=students(2); q=l.ID; % Shouldn't have changed the below v=q W1Q3: Learn from your figures The question is about learning FROM THE FIGURES. Not doing it by hand, not removing the "clear variable" statement, not fudging it. There are still a few different ways of doing it. Option 1 - Simplest xl=xlim; yl=ylim; minAr=min(xl); maxAr=max(xl); minAi=min(yl); maxAi=max(yl); v=minAr+maxAr+minAi+maxAi; Option 2 - Same thing, a tad more complicated xl=get(gca,'xlim'); yl=get(gca,'ylim'); minAr=min(xl); maxAr=max(xl); minAi=min(yl); maxAi=max(yl); v=minAr+maxAr+minAi+maxAi; Option 3 - Even more complicated h=findobj(gca,'Type','line'); x=get(h,'Xdata'); y=get(h,'Ydata'); xl=x(1); yl=y(1); minAr=min([xl{:}]) maxAr=max([xl{:}]); minAi=min([yl{:}]) maxAi=max([yl{:}]) v= minAr + maxAr + minAi + maxAi; W1Q4: Make a formatted string Option 1 - Simple v1=sprintf('%8.6f',notpi(1)); v2=sprintf('%8.6f',notpi(2)); v3=sprintf('%8.6f',pi); Option 2 - Turns out you can be lucky with %f, but I don't rate this as very good, since it relies on a MATLAB default v1=sprintf('%f',notpi(1)); v2=sprintf('%f',notpi(2)); v3=sprintf('%f',pi); Option 3 - Another way to get lucky, but I also don't like it much v1=sprintf('%0.6f',notpi(1)); v2=sprintf('%0.6f',notpi(2)); v3=sprintf('%0.6f',pi); W1Q5: Make an alphanumeric string Option 1 - Right v=sprintf('%ss birthday is %s %i',bdayn,bdayms,bdayd); Option 2 - This is cheating! You're not using the database v=sprintf('%s',bdayn,'s birthday is ',bdayms,' 5')