calculate weighted difference and assigning names to it

1 次查看(过去 30 天)
Dear friends, I am working on one problem, it looks like this, a matrix xxx with n columns, the first row is the name of variables, suppose it has 6 variables, a, b,c,d,e,and f, the second to last row are corresponding observations of these variables. there is another matrix YYY, exactly the same size as xxx, also first row is name variables, aa, bc,cc,dd,ee, and ff, the second to last row are observations. what I want to achieve is to calculate (1/aa)*a-(1/bb)*b, and assign a name to it as ab, no need to calculate ba, which is simply -ab. so, in total, there will be 6*5/2=15 columns to be calculated. can you advise me how to do this task? thanks a lot.
  1 个评论
Guillaume
Guillaume 2014-11-3
Could you give an example of your 'matrices' and the result you want, as it's not very clear what the format of your data is.
In particular, a matrix can't contain strings and numbers, so I suspect what you have are cell arrays or maybe tables.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by