How to control secondary-y-axes characters of xls-chart by matlab commands?

I have draw an Excel chart with matlab commands, which has several lines and both primary/Secondary y-axes are used. My question is: how can I control the secondary y-axes characters with matlab commands?
I cannot find the answer from xlsgraph() or xlschart().
Thanks a lot
[Merged from duplicate]
I add a chart in Excel with matlab commands, which includes several lines and both Primary y-axis and Secondary y-axis are used.
I can change the x-axis & Primary y-axis characters using Chart.Axes(1) & Chart.Axes(2), but I didn't find a way to change the characters of the Secondary y-axis.
I have tried to use Chart.Axes(3) as the handle of the Secondary y-axis but failed.
My question is: How could I change the Secondary y-axis characters of a chart in Excel by matlab commands?
Thank you very much

2 Commenti

I'm not sure what you mean by characters.
We are going to need to see your MATLAB code that creates the graph

Accedi per commentare.

Risposte (1)

Note that an easy way to find out what code you need is to record a macro in excel, do what you want to do manually, and finally look at the code of the macro. It won't be far from the code you have to write in matlab.
To access the secondary axis of the chart, you need to specify it as a second argument to Chart.Axes. It's a value of type xlAxisGroup. In matlab, you either supply 1 (the default if not specified) for Primary axis or 2 for secondary axis.
Chart.Axes(2, 2) %returns a Chart object representing the secondary group of the value axis.
I'm not sure what you mean by characters. If it's the text of axis label you want to change:
Chart.Axes(2, 2).AxisTitle.Text = 'sometext';

2 Commenti

The problem is solved, thank you very much.
I make MATLAB and Excel working together, is to use the powerful computing capabilities of matlab to deal with the complex calculations, and to release the report in a more popular way.
The question can be closed, and I would like to express my sincere thanks again.
The way to close the question is by you accepting the answer.

Accedi per commentare.

Richiesto:

il 15 Lug 2015

Commentato:

il 17 Lug 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by