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 件のコメント

Rik
Rik 2019 年 6 月 4 日
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)
Jaehwi Bong
Jaehwi Bong 2019 年 6 月 4 日
編集済み: Jaehwi Bong 2019 年 6 月 4 日
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)?
Rik
Rik 2019 年 6 月 4 日
Is this what you mean?
R2_value(k)
You're making it confusing by not explaining what you mean with a small example.
Jaehwi Bong
Jaehwi Bong 2019 年 6 月 5 日
Thank you! I got it :)

回答 (0 件)

この質問は閉じられています。

質問済み:

2019 年 6 月 4 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by