What can I do for this Matrix manipulation

I have two types of matrix (29*1 and 168*1). K: 29*1, R: 168*1
The values of K represent specific n-th row of R. And I'd like to take values of R corresponding to K values. In the end, I should have this matrix, R'(29*1) from R(168*1).
What can I do for that?

4 Comments

It is not entirely clear to me what you mean. This is my best guess:
rate(k)
Also, I would change your code a bit in a few places:
number=unique(B(:,1));
tn=numel(number);
initial=rand(1,3);
rate=zeros(tn,1);R2_value=zeros(tn,1);
ft = fittype('a*exp(-x/b)+c');
for i=1:tn
current=ismember(B(:,1),number(i));
[F,gof2] = fit(B(current,2),B(current,3),ft,'StartPoint',initial);
rate(i) = 1/F.b;
R2_value(i)=gof2.rsquare;
end
k=find(R2_value>0.7)
Thank you for your advice, your way is more efficient.
I'm sorry I've changed my question while you commented.
Can I take the value of R corresponding to K (n-th row of R)?
Is this what you mean?
R2_value(k)
You're making it confusing by not explaining what you mean with a small example.
Thank you! I got it :)

Answers (0)

This question is closed.

Asked:

on 4 Jun 2019

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!