Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

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: 63
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 <none@non.net> wrote in message <k8e9e0$1du$1@speranza.aioe.org>...
> 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]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.