plotdata.m

来自「这是《Numerical Methods with MATLAB: Imple」· M 代码 · 共 15 行

M
15
字号
function plotData(fname)
% plotData   Plot (x,y) data from columns of an external file
%
% Synopsis:  plotData(fname)
%
% Input:     fname = (string) name, including extension, of the 
%                    file containing data to be plotted
%
% Output:    A plot in a separate figure window

data = load(fname);    %  load contents of file into data matrix  
x = data(:,1);         %  x and y are in first two columns of data
y = data(:,2);
plot(x,y,'o');

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?