Info

この質問は閉じられています。 編集または回答するには再度開いてください。

i have a question that works backwards

1 回表示 (過去 30 日間)
Omar Almahallawy
Omar Almahallawy 2019 年 4 月 28 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have a set of values for F and a set of values for D.
When F and D are divided together they give a ratio that I have the answers to in variable X
so
X=F./(D.^5)
ex.
F =[
0.0026 0.0026 0.0026 0.0026 0.0027 0.0027 0.0027 0.0028 0.0028 0.0028]
D =[
0.9652 1.0160 1.0668 1.1176 1.1684 1.2192 1.3208 1.4224 1.5240 1.6256]
X=[0.0024 0.0019 0.0015 0.0012 0.0010 0.0007 0.0005 0.0003 0.0002]
I want code that tells me for which F and which D give me the known answer of X
  5 件のコメント
Omar Almahallawy
Omar Almahallawy 2019 年 4 月 29 日
編集済み: dpb 2019 年 4 月 29 日
the desired output would be
F= 0.0026 0.0026 0.0026 0.0027 0.0027 0.0027 0.0028 0.0028 0.0028
D= 1.0160 1.0668 1.1176 1.1684 1.2192 1.3208 1.4224 1.5240 1.6256
% notice that when the corrosponding values of F and D are divided give us X
(F./(D.^5))
(0.0026./(1.0160.^5))= 0.0024
%FIRST VALUE OF F AND D GAVE US THE FIRST VALUE OF X
and so on for the rest
how can i code this to give me the desired output of which F and D has been used to calculate X RESPECTIVLEY
dpb
dpb 2019 年 4 月 29 日
That's a trivial Q? as posed; you calculated X_i from F,D_i so the answer is simply "i" for the set of calculated values.
IF you somehow generate the identically-computed X from some other location, then that Xprime value would match one of the originals; to find which one would be simply
indx=find(X==Xprime);
BUT as was noted in the previous comment, that exact lookup will fail almost certainly owing to floating point rounding and precision issues; perhaps ismember could help resolve that particular problem but somehow I don't think you've yet described what you're after sufficiently for us to understand what the objective is here.

回答 (1 件)

Jos (10584)
Jos (10584) 2019 年 4 月 29 日
What about
% X is known
F = X
D = ones(size(F))
% F ./ (D.^5) equals X
or is this to simply thought by me ;-)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by