Connecting plot points from nested loops

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
roldy
Messages
206
Reaction score
2
Here's small part of a project I'm working on. The code is not part of the grade. I'm just doing this for my own benefit and I figured that MATLAB can do the plotting automatically for me.

Calculate the Mach number at each of the three altitudes for mdotf=.1, .2, .3, .4, .5, .6, .7 The flight Mach number is M_0.

I'm plotting Thrust vs. M_0 for 7 different mdotf values. I need to do this at 3 different altitudes.

I wrote the code to do just this. But I'm stuck at plotting out the three plots.

The code grabs data from an excel sheet to use in calculating M_0. I wanted to have flexibility with the data; in case I needed make a change in the excel sheet, I won't have to change all the values that I'm using in MATLAB. You won't have to do anything with the Excel file. Attached is the .m file and the Excel sheet in a zip file. They have to be in the same folder of course in order to work.
 

Attachments

Physics news on Phys.org
Rather than posting the .zip file, why not just post the MATLAB code in between the [CODE ][/CODE ] tags? A little more description of the data file (format / structure) would also assist us in helping you debug this.
 
I figured out my problem. Thanks for the reply.