필터 지우기
필터 지우기

How to draw with semiology in MATLAB?

조회 수: 5 (최근 30일)
Haitham AL Satai
Haitham AL Satai 2022년 9월 21일
댓글: Haitham AL Satai 2022년 9월 21일
I have below the following information:
Q = [16,32,64,128,256,512,1024];
y = [9 9 9 9 5 0 0]*0.25;
y1 = [45 37 25 21 5 0 0]*0.25;
After multiplication with 0.25 they became as below
y
y1
and the above Q is the same
when I use the semiology plot function as below
semilogy(Q,y,Q,y1)
xlabel('Q oder');
ylabel('Coverage area m^2');
grid on;
I saw the x and y axis are different than what I have in Q and Y as shown below. Does this make sense?
Do I apply it in the wrong way (I mean xlim and ylim not as the values in vectors for example x-axis (16 , 32, ...1024))? If yes, May you assist me?
  댓글 수: 4
Stephen23
Stephen23 2022년 9월 21일
편집: Stephen23 2022년 9월 21일
"I mean xlim and ylim not as the values in vectors for example x-axis (16 , 32, ...1024))"
Because the 0-values are not plotted the corresponding x-values are ignored, so your x data range is from 16 to 256.
Haitham AL Satai
Haitham AL Satai 2022년 9월 21일
@Stephen23 Thanks a lot for your clarification dear.

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

채택된 답변

Chunru
Chunru 2022년 9월 21일
편집: Chunru 2022년 9월 21일
Q = [16,32,64,128,256,512,1024];
y = [9 9 9 9 5 0 0]*0.25;
y1 = [45 37 25 21 5 0 0]*0.25;
% in logscale, log(0) = -inf and it cannot be plotted
semilogy(Q,y,Q,y1)
xlabel('Q oder');
ylabel('Coverage area m^2');
grid on;
xlim(Q([1 end]))
% Why not plot in linear scale when data range is not big?
figure
plot(Q,y,Q,y1)
xlabel('Q oder');
ylabel('Coverage area m^2');
grid on;
% or you should change your data
Q = [16,32,64,128,256];
y = [9 9 9 9 5 ]*0.25;
y1 = [45 37 25 21 5 ]*0.25;
figure
semilogy(Q,y,Q,y1)
xlabel('Q oder');
ylabel('Coverage area m^2');
grid on;
  댓글 수: 1
Haitham AL Satai
Haitham AL Satai 2022년 9월 21일
@Chunru Thank you dear sir. I just wanted to take the both kind of results semiology and line plot and compare between them.

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

추가 답변 (1개)

Dyuman Joshi
Dyuman Joshi 2022년 9월 21일
The graph is correct. The y axis values are shown in log values as you wanted them to be.
And, for the last two values of Q, the corresponding values are 0 in y and y1. So they are not included for the log values.
If you want to identify the points in x axis, you can try changing the xticks, but it might result in a distorted grid. (You can do the same for yticks as well.)
Q = [16,32,64,128,256,512,1024];
y = [9 9 9 9 5 0 0]*0.25;
y1 = [45 37 25 21 5 0 0]*0.25;
semilogy(Q,y,Q,y1)
xlabel('Q oder');
ylabel('Coverage area m^2');
grid on;
%yticks(union(y,y1))
xticks(Q)

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by