From: Justme on 28 Jun 2010 09:45 Good Morning Community, Again, thanks for all of your help as I am starting to feel alot more comfortable with this new area of matlab script writing. I have come with a new question. Currently, I have written a script which asks the user for specific time inputs, which are of course limited by where I have the files being read from (textread) and spits out two different plots based on performance and time (where the second plot based on time, should be based on the first). I have also come to the realization however, that this is becoming more tedious as I get more workload and would like to do two things. 1. Make it fully automated so that my script can automatically read the times already specified from the files without manually being told to. 2. When it produces the two plots, I would like the axis of the SECOND plot produced to represent the same axis of the first. In other words, my first plot has a certain scale of x and y, I would like my second to have the same scaling without me having to manually go in and change them. Makes sense? This is what I currently have (these are just snippets of the code) Also, Is there anyway to make my "titles" of my plots automated as well? So as my plots or being produced, they change based on the different data it reads? Thank again. Trying to make this fully automated. 1. [time1 data1] = textread(Slow_filename,'%f%*s%*s%*s%*s%*s%*s%*s%*s%f'); [time2 data2] = textread(Fast_filename,'%*s%f%*s%*s%*s%f'); user_entry_START = input('Please input starting Time (in seconds):'); user_entry_STOP = input('Please input stop Time (in seconds):'); ind = find(time1 >= user_entry_START & time1 <= user_entry_STOP); user_entry_Data1 = input('Please input starting D_First_Time (in seconds):'); user_entry_Data2 = input('Please input stop D_Second_Time (in seconds):'); ind2 = find(time2 >= user_entry_D_First_Time & time2 <= user_entry_STOP_D_Second Time); Axis question 2. figure(2) plot(x,performance_data,'r*') hold on axis(n values for x and y) plot(x and y) xlabel ylabel title('This I would like to change as it produces plots'); grid on hold off figure(1) axis('Would like this axis to be a reflection of the first plot') hold on xlabel('Seconds'); ylabel('Some Y label (deg)'); legend('Some words here'); title('This I would like to change as it produces plots'); hold off
|
Pages: 1 Prev: window/leveling of image Next: Axis and Textread Question |