28.12.2012 Views

Figure Properties - SERC

Figure Properties - SERC

Figure Properties - SERC

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

genvarname<br />

2-964<br />

record<br />

record =<br />

reading090446: 27.3960<br />

reading090546: 23.4890<br />

reading090646: 21.1140<br />

reading090746: 23.0730<br />

reading090846: 28.5650<br />

.<br />

.<br />

.<br />

Example 4<br />

Generate variable names that are unique in the MATLAB workspace by<br />

putting the output from the who function in the exclusions list.<br />

for k = 1:5<br />

t = clock;<br />

pause(uint8(rand * 10));<br />

v = genvarname('time_elapsed', who);<br />

eval([v ' = etime(clock,t)'])<br />

end<br />

As this code runs, you can see that the variables created by genvarname are<br />

unique in the workspace:<br />

time_elapsed =<br />

5.0070<br />

time_elapsed1 =<br />

2.0030<br />

time_elapsed2 =<br />

7.0010<br />

time_elapsed3 =<br />

8.0010<br />

time_elapsed4 =<br />

3.0040<br />

After the program completes, use the who function to view the workspace<br />

variables:<br />

who

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!