The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: split string and plot
Replies: 4   Last Post: Nov 19, 2012 7:23 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Leyo Joseph

Posts: 67
Registered: 3/19/09
Re: split string and plot
Posted: Nov 19, 2012 6:56 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

dpb <> wrote in message <k8e9e0$1du$>...
> On 11/19/2012 3:30 PM, Leyo Joseph wrote:
> > Hello,
> >
> > I have matlab script to pull out data from a test instrument using TCP/IP.
> > I got the data "stim_freq" as a string with 501 values separated by
> > comma and "stim_gd" as a string with 501 values with comma separation.
> > Using the following, I separated the string==>
> > p=regexp(stim_freq,',','split');
> > pp=regexp(stim_gd,',','split');
> > Now p and pp are cell arrays. How to plot as x axis and pp as y axis?

> Since you want numeric values, rather than regexp(), use textscan instead...
> You'll get cell arrays still, but they'll be numeric and you can skip
> the num2str() of the other way and just
> plot(p{:}, pp{:})
> --

Thanks. Could you please give me a hint on how to proceed with textscan?
The variable "stim_freq " is like (1685000000,1685630000,1686260000,1686890000,1687520000,1688150000,1688780000,.....) and the variable "stim_gd" is like (7.847651617E-009,7.840270671E-009,7.833383973E-009,7.826488771E-009,7.819906752E-009,7.813325228E-009,...).
Basically, I want to plot the elements of stim_freq vs elements of stim_gd.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.