Plot the last value from each cell from excel file
1 回表示 (過去 30 日間)
古いコメントを表示
Hi there,
This is a following question for here:
I applied the way they suggested but I don't get the exact value! Most of the last value in each cell is 50 but I don't get that. Could you please provide me the best way to extract the last values in each cell and plot it?
max_iterations = 500;
xs = 1 : max_iterations;
N1 = importdata('transRewards_40_1_2.csv'); %new trans with modi
N1 =N1{1};
N1 = strrep(N1, '"[', "");
N1 = strrep(N1, ']"', "");
N1 = sscanf(N1, '%f, ', inf);
r1 = mean(reshape(N1,40,[]), 1);
r1 = r1';
ys_01 =r1(1:max_iterations, 1);
plot(xs, ys_01,'Color',[0.75, 0.75, 0]);
The data I mentioned in attachments
1 件のコメント
Stephen23
2022 年 9 月 26 日
"Plot the last value from each cell from excel file"
What Excel file? The file you uploaded is a text file, something that exists completely independently of MS Excel.
採用された回答
Stephen23
2022 年 9 月 26 日
編集済み: Stephen23
2022 年 9 月 26 日
"Could you please provide me the best way to extract the last values in each cell and plot it?"
Sure, I already did that sixteen days ago, here. The method I showed you works as expected, giving the complete matrix, allowing you to trivially select all of the values in the last column. Of course, if you want to use more complex, fragile approaches, that is up to you.
M = readmatrix('transRewards_40_1_2.csv', 'LineEnding',']', 'TrimNonNumeric',true)
plot(M(:,end))
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Import from MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!