how can i get 65=.0003?

if [.003 .006 .009 .012] is an array, how can i get [65 67 68 69] ,that means .003=65;.006=67 so on.how can i get this?

9 Comments

x = [0.003 0.006 0.009 0.012];
You want y = [65 67 68 69]? You can get this with the command
y = [65 67 68 69];
Oh, that's not what you meant? It's not really possible to tell what you actually wanted from your question, so maybe you should spend some more time explaining what you want, so that we understand.
Adam
Adam on 24 Apr 2015
Other than the obvious syntax provided by the cyclist isn't this just a maths problem rather than a Matlab problem? Or do you have the magic formula to go from one array to the other, but aren't sharing it?!
It seems the equation you are looking for is:
y = x*1000/3 + 64;
but I have a feeling there is a bit more than this ...
@Brendan .... Note that the second array is not sequential
The obvious formula is:
>> x = [.003 .006 .009 .012]
x =
0.0030 0.0060 0.0090 0.0120
>> y = 65 + floor(sqrt(x-x(1))*50)
y =
65 67 68 69
Urgh. I thought the formula was
y = x./x + round(sort(roots([1 -265 26330 -1162520 19244544])))'
(at least my formula depends on the value of x ...)
Oh, fine:
y = round(sort(roots([1 (x/0.003)+[-270 27129 -1215982 20433656]])))'
Or... back on topic is the person looking for how to perform a table lookup?

Answers (0)

This question is closed.

Products

Tags

No tags entered yet.

Asked:

on 24 Apr 2015

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!