i have a code that plots a figure. Now say that i don't know what the value of 'a' is. I am trying to write a basic numerical code to find the value of 'a' from the figure/ info (not using really complexed matlab functions). I have a complexed matlab function that i am using to find 'a' also, (thanks Azzi). I plan to compare the basic numerical code with that found with the matlab function. Any help would be appreciated.
%Plots fourier transform.
a=5;
w=-a:a/100:a;
F=2*sin(a*w)./w;
plot(w,F)
%finds value of -a- using complexed matlab functions
x=get(gca,'xlim');
a1=x(end);
disp(a1);

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 8월 15일

0 개 추천

x=get(gca,'xlim')
a=x(end)

댓글 수: 2

harley
harley 2013년 8월 15일
what does the gca bit mean? Gives me the correct right answer. Any ideas on a numerical approach without relying on complexed functions.
Azzi Abdelmalek
Azzi Abdelmalek 2013년 8월 15일
편집: Azzi Abdelmalek 2013년 8월 15일
doc gca
doc gcf
doc gco

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

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by