フィルターのクリア

Using a matrix where every column has a different number of rows, to obtain a matrix with the exact same dimensions for every column.

4 ビュー (過去 30 日間)
for n=1:42;
Lx(max(size(L(1:end,n))))=L(1:end,n).*[sind(theta{n,1}(1:end,1))];
end.
L is a matrix with 42 columns, but every column has a different number of rows. Lx will have the exact same dimensions for every column, it is merely L times the cos of various angles. How can i notate this to produce what i want? should i convert L into a 1x42 array? Also, theta is {42,1} but every element of theta has a one column but different number of rows. this is quite messy i know. thanks!

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 9 月 25 日
Use cell arrays if you need a different number of elements per column (or row).
  2 件のコメント
Andrew Wiebe
Andrew Wiebe 2015 年 9 月 25 日
How do i change L into a cell array?
Walter Roberson
Walter Roberson 2015 年 9 月 25 日
What form is your data in now? It cannot be a numeric array, as numeric arrays always have the same number of rows per column.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by