defining function which generates 3d array within a class. Different behavior in class versus command window
5 ビュー (過去 30 日間)
古いコメントを表示
Barbara Margolius
2025 年 6 月 12 日
回答済み: Barbara Margolius
2025 年 6 月 18 日
This code:
lam = @(t) 3*(1 + 0.8*cos(2*pi*t));
A1 = @(t) reshape([lam(t(:).'); lam(t(:).'); zeros(1, numel(t)); lam(t(:).')], [2, 2, numel(t)]);
tt=0:1/400:1-1/400;
A1stack=A1(tt);
generates a 2x2x400 array. This is what I want to happen. When I embed the code within a class function however, it returns a 2x800 array. How do I fix this?
6 件のコメント
Steven Lord
2025 年 6 月 18 日
To close the loop, would you mind giving a brief description of what the error was?
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



