Exporting sampled data from figure to matlab.

Hello there,
After sampling a sinusoid signal at a given sampling frequency,i want to export range of sample values for any time range from the sampled sinusoid to matlab for further computation.Kindly help me with the program/code to do the same.

5 comentarios

Jan
Jan el 31 de Mzo. de 2022
The question is not clear yet. What are the inputs and and what is the wanted output?
Raashid Hassan
Raashid Hassan el 1 de Abr. de 2022
Thanks for your response.
I want to manupulate the sample vaulues of a sampled sinusoidal signal in matlab for further computation.I sampled the sinusoidal signal. Now i want to export the sample values of signal (from the graphic window-figure) at different instants to matlab so that I can use the same in my algorithm.
These sampled values from the sampled signal form the inputs for my algorithm of fault detection.
How can i export these values to my matlab workspace for further computation.
Regards,
Fangjun Jiang
Fangjun Jiang el 4 de Abr. de 2022
XData and YData give you all the data of the curve in the figure! Hard to understand what you really want.
Raashid Hassan
Raashid Hassan el 4 de Abr. de 2022
Anyways , thank you ! Your help is much appreciable ! Can you please help me with another query : Suppose I have a large array of numbers , about 2807 entries eg A=(....0 3 4 5 7 8 9 5 5 7 8 9 0 4 1 4 5 7 8 .....) Now I wanna compute sum of certain numbers ,eg from 1500th entry to 1901th entry , likewise summation of other ranges ! How can I do that , kindly elaborate !This is required to develop an algorithm!
Fangjun Jiang
Fangjun Jiang el 4 de Abr. de 2022
Users look for questions for ansers. If it is a different question, ask a separate question.

Iniciar sesión para comentar.

 Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 1 de Abr. de 2022
Editada: Fangjun Jiang el 1 de Abr. de 2022
t=0:0.01:10
SinCurve=plot(t,sin(t));
XData=SinCurve.XData;
YData=SinCurve.YData;
NewX=resample(XData,5,3);
If you only have a figure, you can find the line
MyCurve=findobj(FigureHandle,'Type','Line')

6 comentarios

Raashid Hassan
Raashid Hassan el 2 de Abr. de 2022
Thanks for your guidance and swift response ! What does XData=SineCurve.XData signify? Likewise for YData! Moreover , I wanna enlist the x,y coordinates of exported data in a matrix , kindly elaborate !
Regards,
Fangjun Jiang
Fangjun Jiang el 3 de Abr. de 2022
XData and YData are the "x,y coordinates" that you are looking for.
Raashid Hassan
Raashid Hassan el 3 de Abr. de 2022
Thanks. Kindly help me for the following simple query : I wanna plot two sinusoidal waves of different amplitudes in continuation on the same axes . E,g y1= A.sin(t1) and y2= B.Sin(t2)... Where t2 starts at the same instant when t1 ends ,so that the curve is continued as a single graph with two different amplitudes for two periods of time .
Fangjun Jiang
Fangjun Jiang el 4 de Abr. de 2022
Maybe using numeric data to explain is better. What are the values of t1, t2 and others?
Raashid Hassan
Raashid Hassan el 4 de Abr. de 2022
Ex . t1=0:60 t2=60:100 How to plot the two sinusoids on the same axes as a continued single graph?
Fangjun Jiang
Fangjun Jiang el 4 de Abr. de 2022
This is yet another different question than the original one.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 31 de Mzo. de 2022

Comentada:

el 4 de Abr. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by