help-octave
[Top][All Lists]
Advanced

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

Re: Plotting from txt file


From: Andreas Weber
Subject: Re: Plotting from txt file
Date: Sun, 27 Nov 2016 12:37:46 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0

Am 27.11.2016 um 00:51 schrieb skematic:
> filename='output1480196986778.txt';
> fid = fopen(filename, 'r');
> data = textscan(fid, '%s %s %s %s %s %s %s %s %s %s');
> plot(data{1}, data{4});
> fclose(fid);

You read the file as strings so you have to convert them to a numeric
matrix first using "cell2mat":

Replace your plot line with
plot(cell2mat(data{1}), cell2mat(data{4}));

-- Andy



reply via email to

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