how do i print the list corresponding to different column

1 回表示 (過去 30 日間)
andrew
andrew 2013 年 7 月 29 日
I have 2 matrixes (280x1) and (3970x1). I keep getting an error message saying index exceeds matrix. How do I print newfile2 to match up with A (every other 11th cell)?
[nRows,~] = size (A);%size of A(31571x1)
samp=cell(nRows,13);
for n=1:nRows
samp{n,1}=newfile2(n);%size of n 280x1
samp{n,9}=A{n};
end
  4 件のコメント
dpb
dpb 2013 年 7 月 29 日
Say what???
Give a very short sample of only a few lines that demonstrates what you're trying to say. I've no klew and don't think Jan does, either... :)
The crystal ball is in the shop yet again... :(
Walter Roberson
Walter Roberson 2013 年 7 月 29 日
If newfile2 is strings then you should not be indexing it as if it is a plain character array. newfile2(n) is not going to be the N'th string, it is going to be the N'th character. If newfile2 is a cell array of strings, then newfile2{n} would be the N'th string.

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

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by