Aakash Sehgal
Aakash Sehgal

Reputation: 171

How to combine different figures in a Matlab script?

I am workin on a some sort of System test wherein i have a set of readings in the form of a .mat file. It has a structure in the .mat file with one field as Measurement. It has several Arrays(e.g air mass flow, velocity, carbon content) which further have fields like time and value. From these, I Need to plot the velocity and the air mass flow against time. For that i wrote the following command which gave me the corresponding plots:

Now i Need to create a script in matlab wherein i can get both the curves one under the other i.e. on the same page. Can anyone help in the Approach i should procede with ?

ok now i will further extend my question.

But the axis are not matching and the graph for acceleration is very small. Could anyone help me out with this ?
I also want to add a Picture of the Graphs here but unfortunately there is some error here. I hope the question is clear without the Picture.

Upvotes: 2

Views: 185

Answers (1)

NoAnOld
NoAnOld

Reputation: 171

Yes you can use the subplot command, e.g.:

figure
subplot(1,2,1)
plot(Measurement(Measurement.air_mass_flow.time),Measurement.air_mass_flow.value)
subplot(1,2,2)
plot(Measurement.(Measurement.velocity.time),Measurement.velocity.value)

You can use help subplot on Matlab for further details or have a look at this: https://www.dartmouth.edu/~rc/classes/matlab_graphics/Matlab-subplots.html

Upvotes: 3

Related Questions