How to store R Square values in seperate matrix from different regression ?

2 ビュー (過去 30 日間)
Rahul Panchal
Rahul Panchal 2016 年 4 月 18 日
編集済み: Muhammad Usman Saleem 2016 年 4 月 19 日
Hi,
I am plotting 17 different regression plots. So, I have 17 different 17 R_square values. Now I want to store R_Square values in the matrix - 1 row , 17 columns or vice a versa.
Currently I tried following R1 = num2str(STATS(1),3), so on up to 17 R Square values then try to create array or matrix as below
[xR] = [R1 R2 R 3.......R17] save ' xR.mat' xR but this stores as "ans" not as array I tried xR = {R1, R2, R3, ....R17} --- it creates the array but does not create the matrix. --- I may add more regression plots so instead of putting R Square values in array manually. I would like to use loop or if command to store the R_Square values in matrix.
is there any good way to store these R_Square values using loop or if ?
  4 件のコメント
Rahul Panchal
Rahul Panchal 2016 年 4 月 18 日
one row but 17 singe cell columns like R1 R2 R3 ...R17 or one single columns with 17 rows like R1 R2 R3
Muhammad Usman Saleem
Muhammad Usman Saleem 2016 年 4 月 19 日
see my answer below

サインインしてコメントする。

回答 (1 件)

Muhammad Usman Saleem
Muhammad Usman Saleem 2016 年 4 月 18 日
編集済み: Muhammad Usman Saleem 2016 年 4 月 19 日
For single row and 17 column, try this one
xR = [R1; R2; R3;R4;R5;....;R17] ;
This create a matrix 1*17.
What is nature of R1? whether it is vector or some scaler?
According to my understanding of your kind question, You are looking something like this
R1=rand(1,3) %random vector order(1,3)
R1 =
0.9134 0.6324 0.0975
R2=rand(1,3)
R2 =
0.1419 0.4218 0.9157
>> R3=rand(1,3)
R3 =
0.7922 0.9595 0.6557
Now making a matrix of R1,R2,R3
xR=[R1;R2;R3]
xR =
0.9134 0.6324 0.0975
0.1419 0.4218 0.9157
0.7922 0.9595 0.6557

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by