how to plot graph

조회 수: 5 (최근 30일)
nkumar
nkumar 2013년 6월 1일
Can anyone tell how to plot the following graph plz

채택된 답변

Walter Roberson
Walter Roberson 2013년 6월 1일
is it possible to do using sin or cos function with for loop
Yes, but you probably don't want to do that.
The curve you show is not a simple sine or cosine or simple sum or product of sines or cosines. However, since the curve has a finite number of samples (pixels), you could measure the coordinates on a pixel-by-pixel basis and then use an FFT to transform it into an implicit sum of sine waves, each with amplitude and phase. And then, with those amplitude and phase components on hand, you could go through the trouble of reconstructing the plot by calculating all of the sine components and adding them all up. That would be a loop using sine functions. But if you had all of the measurements needed to do this, it would be a lot more efficient to just plot in (x,y) coordinates directly.
Somewhere in the File Exchange is (or was!) a routine that could read image files and interpret the image as a graph to figure out what the data values were. Unfortunately I cannot seem to find the routine.
  댓글 수: 1
Image Analyst
Image Analyst 2013년 6월 1일
편집: Image Analyst 2013년 6월 1일
I've had that one bookmarked for a while:
He could also read in the image with imread() and then use imfreehand (in the Image Processing Toolbox) to trace the curve getting coordinates. Then use ginput(1) to locate the origin and subtract this from the coordinates returned from imfreehand. Then put in the graph units to pixels ratio as a calibration factor that you multiply by, and you're done.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 6월 1일
편집: Azzi Abdelmalek 2013년 6월 1일
If you have the data (y for example) use
plot(y)
legend('ESD status')
grid on
  댓글 수: 4
nkumar
nkumar 2013년 6월 1일
is it possible to do using sin or cos function with for loop
Azzi Abdelmalek
Azzi Abdelmalek 2013년 6월 1일
편집: Azzi Abdelmalek 2013년 6월 1일
But it 's not a cos or sin function. Can you explain what is your goal? and what this curve represent?

댓글을 달려면 로그인하십시오.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by