Removing Specific Elements of a Vector

2 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Logical 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by