help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to read file and plot


From: Stephan Wyder
Subject: Re: How to read file and plot
Date: Wed, 5 May 2010 10:10:28 +0200

Hi Rizal

Reading a text file and plotting its data can easily be done in octave (see 
example below).
Please notice that you have to juggle a bit around with your data, depending on 
the format.
You can always type 'help' in front of a command to get a help text in the 
octave console, or have a
look at the octave documentation.

Stephan

-------------------
% create your dataset (exampledata)
x = (-1:0.1:1);
y = sin(x);
data = zeros(length(x),2);
data(:,1) = x;
data(:,2) = y;

% save data to file (your textfile)
save('-ascii','data2.txt','data');

%load textfile
data2 = load('data2.txt');

%plot data
plot(data2(:,1),data2(:,2));
-------------------



On 05.05.2010, at 09:18, rizal wrote:

> 
> Haii all
> i have on file (example : data.txt), i want read this file and then to plot.
> how to code in octave
> thank`s all
> -- 
> View this message in context: 
> http://octave.1599824.n4.nabble.com/How-to-read-file-and-plot-tp2130534p2130534.html
> Sent from the Octave - General mailing list archive at Nabble.com.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave




reply via email to

[Prev in Thread] Current Thread [Next in Thread]