I need to write a script in Matlab, which will read some data from Excel table and paint a circular graph in Matlab’s figure. However I was adviced to paint it using Excel facilities. It’s not hard to paint a circular graph in Excel but I still haven’t found any way to make it work from Matlab, using Matlab’s figure. I’ve already asked this question on other forums but haven’t receive any answer. I’ll be very grateful for any help.
Share
So, I figured out how to use ActiveX control in Matlab’s figure.
Firstly, you need to install driver mschrt20.ocx (is free and available to download from the internet). In 32-bit system you must put it in C:/System32 then install it by typing ‘regsvr32 mschrt20.ocx’ in cosole (as Administrator).
Then create a Matlab figure and put an ActiveX object to it, save. To activate it type to Matlab’s interpretator something like this:
Now you could see all the properties of the object. In guide choose the right property ‘charType’ and make field ‘Legend’ ‘Visible’ if you need it.
To paint a pie chart using your ActiveX object you need to set the meaning of it’s field ‘ChartData’. It’s a cell 2xn. Use it as in the example below:
That’s how it works. There some other abilities available with ActiveX control.