Thanks Tudor for writing this very handy toolbox, I have been using it for about a year while I am in grad school and it has saved me a lots of time with its robust handling of Touchstone files (much better and faster than the script I wrote myself) and the handling of singularities in network parameter conversion.
One comment, I have made an alternate version of the s2a and a2s functions which take an optional Zo parameter so that you can have non-unit Zo. In this version Bnew=B*Zo and Cnew=C/Zo in s2a, and it simply reverses these factors in a2s. It is easy to do this external to the function for Y and Z parameters since you just multiply or divide by Zo, but a bit messier to do for ABCD parameters. If you like I can send you the files.
22 Jun 2010
Convert colour names (blue,teal,pale green) into RGB triplets.
Author: Ben Mitch
Thanks for writing this, I find it very handy and use it often when I write scripts to plot various measurement data.
Thanks a lot for that beatiful code. Works quite good.
However, there is a bug: one cannot use the symbol "%" within the file name:
When I type: export_fig(f3, 'Post-Process Estimates - diff. weight (+5 +10 +15)kg, Amp 10','-pdf','-q0','-a1','-r160','-nocrop') % lowest quality, no anti-aliasing, reduced resolution
it creates a nice pdf.
However when I add the symbol "%" at the end of the name, that is: Amp 10% I get a strange error message:
>> export_fig(f3, 'Post-Process Estimates - diff. weight (+5 +10 +15)kg, Amp 10%','-pdf','-q0','-a1','-r160','-nocrop')
Error using eps2pdf (line 107)
**** Unable to open the initial device, quitting.
Error in export_fig (line 435)
eps2pdf(tmp_nam, pdf_nam, 1, options.append, options.colourspace==2, options.quality);
14 Jul 2014
Exports figures nicely to a number of vector & bitmap formats.
After updating to R2014b, the crop function for PDF seems not to work properly. This is my test code:
x = -100:0.01:100;y = -3.*x.^2-3.*x+4;
The png, bmp and jpg is being crop perfect.