Subscripted assignment dimension mismatch.

1 回表示 (過去 30 日間)
fede
fede 2016 年 3 月 14 日
編集済み: Walter Roberson 2016 年 3 月 14 日
Hi
I have the vector price <1xn struct> in which we have a several information about a price of a stock. I want to have a vector in which we have all tickers name of the stock, with the following:
nome=zeros(size(price));
for t=1:size(price,2);
nome(1,t)= price(1, t).Ticker;
end
but I have the error: Subscripted assignment dimension mismatch.

採用された回答

Walter Roberson
Walter Roberson 2016 年 3 月 14 日
It is not possible to have a vector of strings in MATLAB, because strings are really vectors of characters. You will need to use cell arrays of strings:
nome{1,t} = price(1, t).Ticker;
  4 件のコメント
fede
fede 2016 年 3 月 14 日
編集済み: Walter Roberson 2016 年 3 月 14 日
yeah but with the following code
for t=1:size(price,2);
nome(1,t)= price(1, t).Ticker;
end
i obtain only a cell of 1x1, indeed 1xn
fede
fede 2016 年 3 月 14 日
I have solved it thx

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

その他の回答 (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