siz=size(couple,1);
hlife=zeros(siz,1);
adf=zeros(siz,1);
correlation=zeros(siz,1);
sharpe_res=zeros(siz,1);
mcoint=zeros(siz,1);
performance_k=zeros(siz,1);
sharpe_k=zeros(siz,1);
performance_res=zeros(siz,1);
cl=num2cell(prices);
ff=[nomes;cl];
%%start*
for ii=1:size(couple,1);
looking_up=couple(ii,:);
[tf, coldix]=ismember(looking_up,f(ii,:));
prices=ff(:,coldix(tf));
prices=prices(2:end,:);
prices=cell2mat(prices);
x=prices(:,2);
y=prices(:,1);
x=flipud(x);
y=flipud(y);
step1
performance_res(ii,1)=paperoni_o_pezzenti;
hlife(ii,1)=halflife;
adf(ii,1)=results.adf;
correlation(ii,1)=ccor;
sharpe_res(ii,1)=sharpe;
sharpe_k(ii,1)=ksharpe;
performance_k(ii,1)=paperoni_o_pezzentik;
mcoint(ii,1)=m_coint;
end
Matlab give me the following error:
Input A of class cell and input B of class cell must be cell arrays of strings, unless one is a string.

3 件のコメント

Geoff Hayes
Geoff Hayes 2016 年 4 月 10 日
fede - what are the variables couple and f? Are they cell arrays or arrays of doubles or...? Please describe the contents for each as it isn't clear from the above code how each is defined.
fede
fede 2016 年 4 月 11 日
Hi f is a cell array, in where in the first row ther's string elements, and in the other row number.
fede
fede 2016 年 4 月 11 日
couples is a matrix nx2 in which for each row ther's two strings, for example
n_1 N_2
n_3 n_4
and so on

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

 採用された回答

Image Analyst
Image Analyst 2016 年 4 月 10 日

0 投票

Like Geoff and the error message says, it's probably got something else in the cells than only strings. Please read the FAQ first, and then fix your code: http://matlab.wikia.com/wiki/FAQ#What_is_a_cell_array.3F
Also, I don't know what's going on in this code, despite an abundance of comments, but I bet a table would be a better and easier choice than a cell array.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Types についてさらに検索

質問済み:

2016 年 4 月 10 日

コメント済み:

2016 年 4 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by