How can I apply a function to some nearby cells of one column and store the results in a new column which we easily do in Excel as shown in the figure ?
3 ビュー (過去 30 日間)
古いコメントを表示

2 件のコメント
Lei Hou
2021 年 10 月 18 日
Hi Manjula,
In MATLAB table, all the columns ( we call them variables) should be in the same height. In your picture, what is your expected value of B1, B2, B4 and B5? Are you OK with saving the new column in another table?
Thanks,
Lei
回答 (1 件)
Arun
2024 年 2 月 22 日
Hi Manjula,
I understand that you wish to apply a function over a column in a moving window order.
MATLAB provides a function, “tA = matlab.tall.movingWindow(fcn,window,tX)”, that applies the function “fcn” once per window as the window moves over the first dimension of “tX”. The output “tA” is the vertical concatenation of the results of applying “fcn” to each window.
For more information regarding “matlab.tall.movingWindow”, please refer the documentation link: https://www.mathworks.com/help/matlab/ref/matlab.tall.movingwindow.html
HTH
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!