Sine function plotting help

I have fourteen values of voltage and fourteen values of time and i want to read these six values from excel sheet and plot them all on a single sine wave how can i do that?
Voltage
1.06 1 1.01 0.966753089 0.975973845 1.07 0.97036187 0.970362 0.964296537 0.971589314 1.01469118 1.042514216 1.029149117 0.965374791
Time
0 -0.090033876 -0.314484214 -0.238352019 -0.205512343 -0.370186674 -0.331612302 -0.331612302 -0.381852625 -0.386896711 -0.380912159 -0.392083906 -0.392418059 -0.41415126
All these values are in a single row of the excel sheet i know i can use xlsread but how to make these values in a sine wave? Also i have another excel sheet which has 16801 rows and 28 columns , how can i plot all these values as a single wave?
ALso i have tried assigning them with two variable and plotting but it doesnt give me a sin wave
Thanks in advance

9 Comments

Not all sets of random numbers are assured to come from a sine wave. In fact, it is true that most do not. So what makes you think that these do? And why are you so positive that your data cannot possibly be corrupted by any number of sources of random noise?
At some point, when you get your data cleaned up, you may want to try some tools such as the curvefitting toolbox. But not until you get better data.
Sounds like you already know how to read the data into MATLAB and how to plot them, and the question is "make these values in a sine wave". In general, arbitrary data may not much resemble a sine wave. However, as you already know from Fourier theory, any signal of any shape can be comprised of a series of sine waves of different frequencies and different amplitudes. These frequencies and amplitudes are given by the Fourier transform and you can use fft() to get them. Once you have that, perhaps you want to take the strongest (highest amplitude) component as the "dominant" frequency and plot just that one sine wave. We don't really know until you explain more what you're after.
Well, actually, the data shown are not equally spaced in time. So use of fft directly here may be problematic.
It definitely looks bizarre - nothing at all like a sine wave:
I think crotchety old Fourier himself, now long dead and gone, had a minor heart attack when he saw that data. You want to do what?
the data i sent is not corrupted as it has been generated through matlab the data represents values of voltage and time of a power system
Also im trying to use kalman filter analysis on my data can you'll please check this post and help me out
https://in.mathworks.com/matlabcentral/answers/335449-kalman-filter-in-matlab
this has one of my code too and here i used dsp.signalsource to generate my wave , i ddnt get a sine wave but atleast the graph looks linear as compared to when i plot it just as it is
Only you know what the data has to do with a sine wave. There is no visibly sinusoidal relationship there. That you don't see a sine wave in the plot should be a big hint - that you have something wrong.
ok thanks
can u please help me out with this question too https://in.mathworks.com/matlabcentral/answers/335536-please-help-with-my-code

Sign in to comment.

Answers (0)

Asked:

on 14 Apr 2017

Commented:

on 15 Apr 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!