Matlab - What does an array definition mean

Click For Summary
SUMMARY

The discussion centers on using MATLAB's plotyy function to create a plot with two y-axes for different data scales, specifically temperature and air flow rate. The user initially attempted to set line widths but encountered issues. The solution involved using the syntax [AX,H1,H2] = plotyy(time,reactor_temperature_matrix,time,air_flow_matrix) and adjusting the line width with set(H2,'LineWidth',2). The user inquired about the meaning of the output variables [AX,H1,H2], which are handles for controlling graphical object properties.

PREREQUISITES
  • Familiarity with MATLAB programming environment
  • Understanding of plotting functions in MATLAB
  • Knowledge of graphical object handles in MATLAB
  • Basic concepts of data visualization techniques
NEXT STEPS
  • Study MATLAB's plotyy function documentation for advanced plotting techniques
  • Learn about graphical object handles in MATLAB
  • Explore MATLAB's set function for modifying plot properties
  • Investigate multi-axis plotting techniques in MATLAB for complex data visualization
USEFUL FOR

This discussion is beneficial for MATLAB users, data analysts, and engineers who need to create complex visualizations with multiple data sets on different scales.

luitzen
Messages
47
Reaction score
0
I'm trying to make a MATLAB plot with two types of data, i.e. temperature and air flow rate. Since the temperature and air flow rate are on different scales I wanted two y-scales and since there are quite some data sets, I wanted to make the two air flow rates bold.

I tried this, but it doesn't work:

plotyy(time,reator_temperature_matrix,time,air_flow_matrix,'LineWidth',2)

After a long journey, I ended up here: http://www.mathworks.com/matlabcentral/newsreader/view_thread/81078

And saw it solved the following way:

[AX,H1,H2] = plotyy(time,reactor_temperature_matrix,time,air_flow_matrix) ;
set(H2,'LineWidth',2)

This solved my problem, though now I'm curious what [AX,H1,H2] means and I couldn't find it anywhere on the internet. What does '[AX,H1,H2] = ...' create? Can I choose any name for AX, H1 and H2?

When I go to the workspace, I see three vectors with some numbers, but they don't make any sense to me.
 
Physics news on Phys.org
Thank you very much. When I have time I'll will try to read up on handles. My plots now look exactly the way I want them to look.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 6 ·
Replies
6
Views
22K
  • · Replies 9 ·
Replies
9
Views
3K
Replies
2
Views
20K
  • · Replies 8 ·
Replies
8
Views
9K
  • · Replies 45 ·
2
Replies
45
Views
6K
  • · Replies 9 ·
Replies
9
Views
8K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K