Removing Specific Elements of a Vector

2 ビュー (過去 30 日間)
Jonathan Pinko
Jonathan Pinko 2020 年 3 月 2 日
回答済み: Jonathan Pinko 2020 年 3 月 3 日
Hi all,
I am having a problem trying to remove certain elements from a vector. Here is the situation: for the variables xq and Feyq, I am retrieving specific information regarding the Fo and DeltaFe56 content from a previously defined excel spreadsheet. In the next two lines of my code (illustrated on the attached plot), I am finding the vertical distance from my curve Fo,DeltaFe56 to my plotted points.
I then shortened the column vector Fezq to only contain values with absolute values than .025. After I'd completed this step, Felimit was defined as the vector
-.0162
.0244
So now this is the problem: I would like to add the specific Fevq values that I previously subtracted from these Feyq values that correspond to these two values for Felimit, thus generating a column vector that contains the two points in Feyq that are closest to this curve. I am unsure of how to shorten the Fevq vector to only contain the two points that I would like to add to my Felimit values.
Can anyone help me with this? Please let me know if I can provide more information.
xq = dataset(1:116,1);
Feyq = dataset(1:116,2);
Fevq = interp1(Fo,DeltaFe56,xq);
Fezq = Feyq-Fevq;
Felimit = Fezq(Fezq <= abs(.025));

採用された回答

Jonathan Pinko
Jonathan Pinko 2020 年 3 月 3 日
It turns out the answer was really straightforward - I just needed to adjust the line "Felimit = Fezq(Fezq <= abs(.025)) to be Felimit = Feyq(Fezq <= abs(.025)).

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by