# How can i plot this function? y=0.75/(log10(x)*2).^2

조회 수: 1(최근 30일)
Lucas Lombao Pascual 2022년 10월 31일
댓글: Lucas Lombao Pascual 2022년 10월 31일
Hi, ive been trying differents ways of plotting fuctions such as log, implicit... but i cant manage to plot in 2D the next function in matlab
y= 0.75/(log10(x)*2).^2

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

### 채택된 답변

RAGHUNATHRAJU DASHARATHA 2022년 10월 31일
As per my understanding you want to plot the given function in 2D plot .
It is just that you forgot to add '.' before '/' to do element wise operation.I will explain it with the example below
x=2:10;
y= 0.75./(log10(x)*2).^2
y = 1×9
2.0691 0.8237 0.5173 0.3838 0.3097 0.2625 0.2299 0.2059 0.1875
plot(x,y) ##### 댓글 수: 1표시숨기기 없음
Lucas Lombao Pascual 2022년 10월 31일
You're right, thank you

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

### 추가 답변(3개)

Jon 2022년 10월 31일
Something like this?
x = linspace(1,10); % or whatever interval you would like change accordingly
y = 0.75 ./(log10(x).^2).^2 % note .^ for element wise power on log10(x)
y = 1×100
1.0e+05 * Inf 3.6781 0.2707 0.0623 0.0228 0.0107 0.0059 0.0036 0.0024 0.0017 0.0012 0.0009 0.0007 0.0006 0.0005 0.0004 0.0003 0.0003 0.0002 0.0002 0.0002 0.0002 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001
figure
plot(x,y) % Or maybe you want the final power of 2 apply to the numerator and the
% denominator?
y = (0.75 ./(log10(x).^2)).^2
y = 1×100
1.0e+05 * Inf 2.7586 0.2030 0.0467 0.0171 0.0080 0.0044 0.0027 0.0018 0.0012 0.0009 0.0007 0.0005 0.0004 0.0003 0.0003 0.0002 0.0002 0.0002 0.0002 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001
plot(x,y) ##### 댓글 수: 0표시숨기기 이전 댓글 수: -1

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

Mike Croucher 2022년 10월 31일
x = linspace(0.01,0.99,100); % Avoid tricky inputs like 1
y = 0.75./(log10(x)*2).^2;
plot(x,y) ##### 댓글 수: 0표시숨기기 이전 댓글 수: -1

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

Torsten 2022년 10월 31일
What do you mean by "in 2D" ? It is a simple function to be plotted y vs. x:
x = 2:0.01:5;
y = 0.75./(log10(x)*2).^2;
plot(x,y) 댓글을 달려면 로그인하십시오.

### 범주

Find more on Graphics Performance in Help Center and File Exchange

R2022b

### Community Treasure Hunt

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

Start Hunting!