Thanks Jose for saving me some time finding out what Matlab should make clear in documentation. (Wish I'd spotted your contribution a couple of days ago!). The fonts actually supported in PRINT or SAVEAS in espc2 formats is apparently version- and platform-dependent.
On MATLAB Mac OS X Version: 10.6.7 Build: 10J869, the only fonts I could find that wound up in eps files were these: 'Courier' 'Helvetica' 'Palatino' 'Symbol' 'Times' 'Times New Roman' 'Zapf Dingbats'
Both Times New Roman and Times showed up as 'Times-Roman' in the eps file, but at least they weren't changed to 'Helvetica'.
22 May 2011
printeps
This works around MATLABs tendency to call all fonts 'Helvetica' in .eps files.
Author: Jose Aumentado
I work with eps figures in adobe illustrator and it has been a continual pain reconfiguring the fonts from matlab exported eps files. Thanks for the function.
One comment for illustrator users. Adobe illustrator (at least on my system) uses the times new roman font TimesNewRomanPSMT, so embedding the actual font name "Times New Roman" returned from get(gca,'FontName') still gives an error in illustrator. My workaround was to hard code actualfont = 'TimesNewRomanPSMT' since I always work with times. Just a heads up for anyone in a similar position.
04 Oct 2010
printeps
This works around MATLABs tendency to call all fonts 'Helvetica' in .eps files.
Author: Jose Aumentado
Search closest value in a vector
search value in sorted vector and find index and value with respect to vector that is equal or clos
akash varma
Kindly trap the case where the no. to be searched is outside the bounds. Eg:
x = [23,45,67,89,78,90]
[i,cv] = searchclosest(x,91)
gives error
?? Index exceeds matrix dimensions.
Error in ==> searchclosest at 49
y=x(to:from); %vector to be serach for closest value
Comment only
18 Mar 2008
Search closest value in a vector
search value in sorted vector and find index and value with respect to vector that is equal or clos
Schneider Huetter
thanks!
4
07 Jul 2007
Search closest value in a vector
search value in sorted vector and find index and value with respect to vector that is equal or clos
. ..
thank you
4
29 May 2007
Search closest value in a vector
search value in sorted vector and find index and value with respect to vector that is equal or clos
Dimitri Shvorob
Point taken; my concern is limited applicability of the code - to distinct-valued vectors, really. Btw, here's a binary-search imlementation, submitted to FEX in 2005.
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=7552&objectType=file
Comment only
26 May 2007
Search closest value in a vector
search value in sorted vector and find index and value with respect to vector that is equal or clos
M Ali
For large data size this method is extremely faster compared to using
>> z=abs(x-v);
>> [i]=find(min(z)==z).
Because it uses Binary search to for initial step. The behavior is normal because
1. Sorted input is required for binary search.
2. Binary search can return any value if more than one matches.
Many time we have to sorted the data onces but search it for millions of times e.g., Telephone directory, dictionary etc. That why binary search is preferred over linear search, even though it requires sorted input.
Comment only