Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Converting every cell of a cell array into arrays?

1 回表示 (過去 30 日間)
Sevil Cansu Yildirim
Sevil Cansu Yildirim 2020 年 2 月 3 日
閉鎖済み: Stephen23 2020 年 2 月 4 日
Hello,
I have a 5x13 cell array DIST that every cell contains some values (every cell have different size).
I need to calculate some statistical moments for every cell of this array.
Here you can see my code.
for i = 1:nlat
for j = 1:nlon
CELL = [DIST{i,j}]; % TREAT EVERY SINGLE CELL AS AN INDIVIDUAL ARRAY
LD(i,j) = exp(MDIST(i,j)+0.5*(SDIST(i,j).^2)); % CALCULATING LOGARITMIC PDF
GD(i,j) = (1./(SDIST(i,j)*2*pi))*exp(-0.5*((DIST{i,j}-MDIST(i,j))./SDIST(i,j)).^2); % CALCULATING GAUSSIAN PDF
end
end
But I end up with this error message:
Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-0.
Error in all_velocities4 (line 54)
GD(i,j) = (1./(SDIST(i,j)*2*pi))*exp(-0.5*((DIST{i,j}-MDIST(i,j))./SDIST(i,j)).^2); % CALCULATING GAUSSIAN PDF
  1 件のコメント
Stephen23
Stephen23 2020 年 2 月 3 日
You could preallocate the LHS as a cell array and allocate to that. But possibly the empty RHS indicates a problem in your code which should be fixed.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by