Differentiation of a data inside a Cell array

I have cell array called "s". Inside it there is only one data matrix. I need to do differentiation ( derivative) of that data ( which was inside the cell array s) with respect to the length of thr p matrix. To do the differentiation I used the following process. Is my approach correct ?
Thanks in ADVANCE !!
s = {rand(15,5)};
t = cell2mat(s);
a = diff(t);
p = [1 2 3];
q = a/length(p); % dx/dy form

1 件のコメント

Walter Roberson
Walter Roberson 2022 年 6 月 4 日
How does changes in the length of p cause t to behave differently? I would understand if p was the same length as the rows or columns, but it is not.

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

回答 (1 件)

Walter Roberson
Walter Roberson 2022 年 6 月 4 日

0 投票

I suspect that what you want is
q = gradient(p, s{1})

カテゴリ

ヘルプ センター および File ExchangeResizing and Reshaping Matrices についてさらに検索

製品

質問済み:

2022 年 6 月 4 日

回答済み:

2022 年 6 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by