Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Plot data from text file

Subject: Plot data from text file

From: Model Ramachandran

Date: 1 Sep, 2009 07:23:03

Message: 1 of 4

Hi Friends,

I would like to plot few data from text file .In text file I have x & y data Which is:

0.500000 0.2333000
0.250000 0.2556000
0.160000 0.2683000
0.130000 0.2808000
0.090000 0.3082000
0.070000 0.3423000
0.065000 0.3502000
0.060000 0.3528000
0.045000 0.2648000

I am using following command to plot

data=handles.data'; (it show 3*8 matrix)
rdo=get(handles.rdoIdVg,'Value');
if rdo==1
figure(1)
plot(data(:,1),data(:,2),'o');hold on,grid on;

The Problem is I am able to plot only 3 values .Could any one tell me whats wrong in this command. ( I am using pushplot_callback option)

THanks

Subject: Plot data from text file

From: dpb

Date: 1 Sep, 2009 14:09:19

Message: 2 of 4

Model Ramachandran wrote:
...
> I am using following command to plot
>
> data=handles.data'; (it show 3*8 matrix)
> rdo=get(handles.rdoIdVg,'Value'); if rdo==1 figure(1)
> plot(data(:,1),data(:,2),'o');hold on,grid on;
>
> The Problem is I am able to plot only 3 values .Could any one tell me
> whats wrong in this command. ( I am using pushplot_callback option)

Nothing's wrong as written -- you say you have a 3x8 array and asked to
plot the 2nd column vs the first--which are three elements long...

--

Subject: Plot data from text file

From: Model Ramachandran

Date: 2 Sep, 2009 01:59:06

Message: 3 of 4

Hi dpb,

Thanks for your reply.

I would like to plot all the values,But its taking only 3 values.

To plot all the values I have to convert into some x*y format...?

Thanks

dpb <none@non.net> wrote in message <h7ja6j$82s$3@news.eternal-september.org>...
> Model Ramachandran wrote:
> ...
> > I am using following command to plot
> >
> > data=handles.data'; (it show 3*8 matrix)
> > rdo=get(handles.rdoIdVg,'Value'); if rdo==1 figure(1)
> > plot(data(:,1),data(:,2),'o');hold on,grid on;
> >
> > The Problem is I am able to plot only 3 values .Could any one tell me
> > whats wrong in this command. ( I am using pushplot_callback option)
>
> Nothing's wrong as written -- you say you have a 3x8 array and asked to
> plot the 2nd column vs the first--which are three elements long...
>
> --

Subject: Plot data from text file

From: dpb

Date: 2 Sep, 2009 02:09:53

Message: 4 of 4

Model Ramachandran wrote:
...[top posting repaired...please don't do that;
backward makes conversation...]

> dpb <none@non.net> wrote in message <h7ja6j$82s$3@news.eternal-september.org>...
>> Model Ramachandran wrote:
>> ...
>>> I am using following command to plot
>>>
>>> data=handles.data'; (it show 3*8 matrix)
>>> rdo=get(handles.rdoIdVg,'Value'); if rdo==1 figure(1)
>>> plot(data(:,1),data(:,2),'o');hold on,grid on;
>>>
>>> The Problem is I am able to plot only 3 values .Could any one tell me
>>> whats wrong in this command. ( I am using pushplot_callback option)
>> Nothing's wrong as written -- you say you have a 3x8 array and asked to
>> plot the 2nd column vs the first--which are three elements long...

...
 > I would like to plot all the values,But its taking only 3 values.
 >
 > To plot all the values I have to convert into some x*y format...?
...

Well, it plotted what you asked for if the matrix was/is 3x8.

What's perplexing is your sample data appears to be 9x2 as opposed to
3x8 which not only isn't conformant in shape but isn't the same total
number of observations, either.

What, specifically, you need to do depends on what the data are and
which are independent and dependent.

I note you transposed on the input above; if you didn't do that you'd
have an 8x3 instead of 3x8 which your plot() command would give still
the first two columns as x/y and be 16 of the 24 values.

But, I have no way to know (and my crystal ball is in the shop) how 3x8
or 8x3 is supposed to morph into what you expect as you've not said what
you expect (other than aforementioned example that doesn't correspond,
either)...

So, w/o better input from there, not much more better output from here,
sorry...

--

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us