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

3 ビュー (過去 30 日間)
Wang Jian
Wang Jian 2015 年 7 月 15 日
コメント済み: Guillaume 2015 年 7 月 17 日
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 件のコメント
Guillaume
Guillaume 2015 年 7 月 15 日
編集済み: Guillaume 2015 年 7 月 17 日
I'm not sure what you mean by characters.
Walter Roberson
Walter Roberson 2015 年 7 月 17 日
We are going to need to see your MATLAB code that creates the graph

サインインしてコメントする。

回答 (1 件)

Guillaume
Guillaume 2015 年 7 月 17 日
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 件のコメント
Wang Jian
Wang Jian 2015 年 7 月 17 日
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.
Guillaume
Guillaume 2015 年 7 月 17 日
The way to close the question is by you accepting the answer.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by