0

How can I solve an equation such as

(1/5)^x - 4x = 0

using Matlab?

Franck Dernoncourt
  • 77,520
  • 72
  • 342
  • 501
gruber
  • 28,739
  • 35
  • 124
  • 216

3 Answers3

2

That's not an equation, it's just an expression. Did you mean this?

(1/5)^x - 4x = 0

1

Try the solve function.

syms x
solve((1/5)^x - 4x)
Squazic
  • 3,670
  • 3
  • 26
  • 40
1

Alternatively you can use MATLAB's gatool if your equation is complex.

function [F]=fitness_A(x)
F = abs((1/5).^x - 4.*x);
end

enter image description here

Full size: http://img534.imageshack.us/img534/4428/gatool2.png (showing another fitness function).

Franck Dernoncourt
  • 77,520
  • 72
  • 342
  • 501