MATLAB Answers

## plot the following functions using axes that will produce a stright line

Asked by Jack

### Jack (view profile)

on 23 Feb 2012
Latest activity Edited by Chong Tao

### Chong Tao (view profile)

on 21 Oct 2013
Accepted Answer by the cyclist

### the cyclist (view profile)

Can someone show me how to plot the following functions using axes that will produce a stright-line plot using Use the range 0 \< x \< 10

1) The power function y= 2x^-0.5 2) The exponential function y= 10^(1-x)

Thanks

## Products

No products are associated with this question.

## 2 Answers

### the cyclist (view profile)

Answer by the cyclist

### the cyclist (view profile)

on 23 Feb 2012
Accepted answer

In the first case you can use loglog():

```x = 1:0.1:10;
y = 2*x.^(0.5);
loglog(x,y)
```

In the second case you can use semilogy();

```x = 1:0.1:10;
y = 10.^(1-x);
semilogy(x,y)
```

Jack

### Jack (view profile)

on 23 Feb 2012

Thanks man ur the best!

the cyclist

### the cyclist (view profile)

on 23 Feb 2012

Please consider "accepting" this answer, since it sounds like it resolved your question.

### Honglei Chen (view profile)

Answer by Honglei Chen

### Honglei Chen (view profile)

on 23 Feb 2012

I don't quite understand what you mean by using axes. But if you use

```loglog(x,y)
```

for the first function and

```semilogy(x,y)
```

for the second function, they'll look like straight lines, basically taking advantage of logarithms.

#### 0 Comments

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

### Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

### MATLAB Academy

New to MATLAB?

Learn MATLAB today!