Steve on Image Processing
October 20th, 2006
Getting MATLAB code from blog postings
Back in January, I wrote that I was using the MATLAB publish feature to generate some of my blog posts. Since then, I've used publish for almost every post. I write my post as a MATLAB script, and then I use publish to turn the script into a web page. Command window output and figure screenshots are automatically captured.
This week, a few of us in development have been experimenting with using Javascript to make it easy to grab the MATLAB script code when you are looking at a web page published by MATLAB. It now seems to be working well enough to tell you about it and to invite you to try it.
Look near the bottom of my two previous posts (about the Hough transform and about the MATLAB default image). Just above the "Published with MATLAB 7.3" line on the right, you'll see a new link that says "Get the MATLAB code." If you click on that link, my original MATLAB script will pop up in a new window. You can then copy-and-paste the code into your own M-file and run it yourself.
Please let me know what you think about this. Depending on the feedback I get, I may go back through my old blog posts and add in this link. Also, Loren may also start doing this soon in her Art of MATLAB blog, so she'll be interested in your feedback, too.
10:31 am |
Posted in Uncategorized |
Permalink |
You can follow any responses to this entry through the RSS 2.0 feed.
You can skip to the end and leave a response. Pinging is currently not allowed.
Leave a Reply
|
I wrote a script to colorize M-files and MATLAB syntax two years ago, I think it was before you guys released this publish tool (http://www.pitchup.com/matlabcolorizer/)
It seems there is no reason for people to use my code anymore :( people are still using that though :)
However I have to confess I am happy to see matlab is getting this user-friendly that you can actually write your blog posts on it
P.S: I hope you guys don’t want to release MATLAB OS soon ;)
Respected Steve,
For me it saves a lot of time.
Its good to follow the javascript for the older blog posts.
Kathirvel - I have now added the Javascript link to my older blog posts.
I really like the “get MATLAB code” option. I use this to help me write my own m-files for publishing. How do I add this feature to my publications?
hello,i’m student.I’m a new in image processing.I’m interesting in how to identity the object.
example:Circle,rectangle,triangle to classify this object with different size.please help how to do.thanks
Eric - The “Get MATLAB code” option was inspired by discussions between our external bloggers and the development team responsible for the publish feature. It wouldn’t surprise me to see something along these lines show up in a future release. What I’ve done is write an M-file that postprocesses the published HTML to insert a Javascript function that grabs the MATLAB code and sends it to the browser. If you view the source of one of our published blog postings, you’ll find this Javascript function in it. You can insert this function into your own published HTML manually, or you can write an M-file to do it. Not exactly push-button easy, I know, but that’s what we have at the moment.
Steve,
Thanks for the reply. One of our web gurus has figured out how to modify the HTML style sheet to include the get_code java script automatically. Maybe we will post this style sheet on the user community file exchange.
Good idea, Eric. I’m sure other people would be interested in your solution.