How to store my data

4 ビュー (過去 30 日間)
M03
M03 2018 年 11 月 12 日
編集済み: Star Strider 2018 年 11 月 12 日
Hi! I have the following code for 20000x2 data. Everything should be correct, only thing is that I need to store the w's to be able to plot them. Please, can anyone help me with the code? I tried to add (i) behind trajectories in the last line, but it returned that the left side is not compatible with the size on the right side.
load('ojaData-2.mat')
w = [0.15; 0.25]
for i = 1:20000
x = ojax(i,:)
o = x*w
w = w+0.01*o*(x'-o*w)
trajectory(i) = w
end

採用された回答

Star Strider
Star Strider 2018 年 11 月 12 日
Since we do not have your ojaData-2.matfile, the only recommendation I have is to save ‘trajectory’ as a cell array:
trajectory{i} = w
Note the curly brackets {} indicating cell array indexing.
  2 件のコメント
M03
M03 2018 年 11 月 12 日
It works, but the plot doesn't look as it should look
Star Strider
Star Strider 2018 年 11 月 12 日
編集済み: Star Strider 2018 年 11 月 12 日
You may need to use the cell2mat function to use the data as numeric double values.
With all due respect, I do not have your data. I also do not know how your plot should look. I do not even have any idea what you are plotting.
However, if my Answer helps you solve your problem, please Accept it!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by