This preview shows page 1. Sign up to view the full content.
Unformatted text preview: graphical capabilities. Suppose for example that want to plot y as a function of x . Assume that we save the data from C++ in a le called My_File.dat with the following format: 0 2 .3 2.5 .6 4.2 .9 5.9 ... i.e. the rst column refers to the x s and the second column refers to the corresponding y s. The following Matlab commands will be used to plot y versus x : load My_File.dat; % Load the file into Matlab. x=My_File(:,1); % Assign x to be the first column of the file. y=My_File(:,2); % Assign y to be the second column of the file. plot(x,y); % Plot y as a function of x. 1...
View Full Document
- Spring '12