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 Kommentare

the cyclist
the cyclist am 24 Apr. 2015
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 am 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?!
Brendan Hamm
Brendan Hamm am 24 Apr. 2015
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 ...
the cyclist
the cyclist am 24 Apr. 2015
@Brendan .... Note that the second array is not sequential
James Tursa
James Tursa am 24 Apr. 2015
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
the cyclist
the cyclist am 24 Apr. 2015
Urgh. I thought the formula was
y = x./x + round(sort(roots([1 -265 26330 -1162520 19244544])))'
James Tursa
James Tursa am 24 Apr. 2015
(at least my formula depends on the value of x ...)
the cyclist
the cyclist am 24 Apr. 2015
Oh, fine:
y = round(sort(roots([1 (x/0.003)+[-270 27129 -1215982 20433656]])))'
Joseph Cheng
Joseph Cheng am 24 Apr. 2015
Or... back on topic is the person looking for how to perform a table lookup?

Antworten (0)

Diese Frage ist geschlossen.

Produkte

Tags

Noch keine Tags eingegeben.

Gefragt:

am 24 Apr. 2015

Geschlossen:

am 20 Aug. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by